home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_362 / fenster / fensterv2.2.s < prev    next >
Text File  |  1992-05-06  |  56KB  |  2,757 lines

  1.  
  2.  
  3.  
  4. ;   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  5. ;   ­­                                                                ­­
  6. ;   ­­               Fenster V2.2 [ 14th.April.1990 ]                 ­­
  7. ;   ­­                                                                ­­
  8. ;   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  9. ;   ­­                                                                ­­
  10. ;   ­­                     by Roger Fischlin                          ­­
  11. ;   ­­                        Steigerwaldweg 6                        ­­
  12. ;   ­­                        6450 Hanau 7                            ­­
  13. ;   ­­                        West Germany                            ­­
  14. ;   ­­                                                                ­­
  15. ;   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  16. ;   ­­                                                                ­­
  17. ;   ­­    This program is freeware and may be freely distributed as   ­­
  18. ;   ­­             long as you don't gain any profit.                 ­­
  19. ;   ­­                                                                ­­
  20. ;   ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  21.  
  22.  
  23.  
  24.     incdir       "ram:include/"
  25.  
  26.     include    intuition/intuition.i
  27.     include    intuition/intuition_lib.i
  28.             include     exec/memory.i
  29.     include    exec/exec_lib.i
  30.     include    graphics/graphics_lib.i
  31.     include    graphics/text.i
  32.     include    libraries/dos_lib.i
  33.     include    libraries/dos.i
  34.     include    devices/printer.i
  35.     include    XColor.i
  36.  
  37.  
  38. FontFlag    set    0
  39.  
  40. SETAPEN    macro
  41.     move.l    WindowPointer(pc),a1
  42.     move.l    wd_RPort(a1),a1    
  43.     moveq.l    \1,d0
  44.     CALLGRAF    SetAPen
  45.     endm
  46.  
  47. SETBPEN    macro
  48.     move.l    WindowPointer(pc),a1
  49.     move.l    wd_RPort(a1),a1    
  50.     moveq.l    \1,d0
  51.     CALLGRAF    SetBPen
  52.     endm
  53. SETDRMD    macro
  54.      move.l    WindowPointer(pc),a1
  55.     move.l    wd_RPort(a1),a1    
  56.     moveq.l    \1,d0
  57.     CALLGRAF    SetDrMd
  58.     endm
  59.  
  60. RECTFILL    macro
  61.     move.l    WindowPointer(pc),a1
  62.     move.l    wd_RPort(a1),a1    
  63.     move.w    \1,d0
  64.     move.w    \2,d1
  65.     move.w    \3,d2
  66.     move.w    \4,d3
  67.     CALLGRAF    RectFill
  68.     endm
  69.  
  70. BORDER    macro
  71.     bra.s    MakeBox_\@
  72. MakeBox2_\@    BOX    \1,\2,\3,\4,\5,0
  73. MakeBox_\@    move.l    WindowPointer(pc),a0
  74.     move.l    wd_RPort(a0),a0
  75.     lea.l    MakeBox2_\@(pc),a1
  76.     moveq.l    #0,d0
  77.     moveq.l    #0,d1
  78.     CALLINT    DrawBorder
  79.     endm
  80.  
  81. WRITE    macro
  82.     move.l    WindowPointer(pc),a1
  83.     move.l    wd_RPort(a1),a1
  84.     move.l    a1,a3    
  85.     move.w    \1,d0
  86.     move.w    \2,d1
  87.     CALLGRAF    Move
  88.     move.l    a3,a1    
  89.     moveq.l    \3,d0
  90.     jsr    _LVOSetAPen(a6)
  91.     lea.l    Write_Text\@(pc),a0
  92.     move.l    a3,a1
  93.     move.l    #Write_Ende\@-Write_Text\@,d0
  94.     jsr    _LVOText(a6)
  95.     bra    Write_Label\@
  96. Write_Text\@    dc.b    \4
  97. Write_Ende\@    dc.b    0
  98.     even
  99. Write_Label\@    nop
  100.     endm
  101.  
  102.  
  103.  
  104. BOX    macro            ; macro to create a border structure
  105.     dc.w    0,0
  106.     dc.b    \5,0,RP_JAM1,5
  107.     dc.l    box_\@,\6
  108. box_\@    dc.w    \1,\2,\3,\2,\3,\4,\1,\4,\1,\2
  109.     endm
  110.  
  111. TEXT    macro            ; macro to create a text structure    
  112.     dc.b    2,0,RP_JAM1,0
  113.     dc.w    \1+1,\2+1
  114.     dc.l    TOPAZ_80,T_String\@,Text2_\@
  115. Text2_\@    dc.b    \3,0,RP_JAM1,0
  116.     dc.w    \1,\2
  117.     dc.l    TOPAZ_80,T_String\@,0
  118. T_String\@    dc.b    \4,0
  119.     even
  120.  
  121.  
  122.     IFEQ    FontFlag
  123.  
  124. TOPAZ_80    dc.l    T_80name
  125.     dc.w    TOPAZ_EIGHTY
  126.     dc.b    FS_NORMAL,FPF_ROMFONT
  127.     even
  128. T_80name    dc.b    "topaz.font",0
  129.  
  130. FontFlag    set    1
  131.     endc
  132.     endm
  133.  
  134.  
  135. AUTOGADGET    macro
  136. * \1,\2    x,y
  137. * \3,\4    size
  138. * \5,\6    colors (text & Box)
  139. * \7       Text
  140. * \8       ID
  141. * \9       NextGadget
  142.  
  143.     dc.l    \9
  144.     dc.w    \1,\2,\3,\4
  145.     dc.w    GADGHCOMP,RELVERIFY,BOOLGADGET
  146.     dc.l    AGadget\@_Box
  147.     dc.l    0,AGadget\@_Text,0,0
  148.     dc.w    \8,0,0
  149. AGadget\@_Box    BOX    -1,-1,\3,\4,\5,0
  150.     even
  151.  
  152. AG_T_String\@    dc.b    \7,0
  153. AG_T_String\@_End    
  154.     even
  155. AGadget\@_Text    dc.b    2,0,RP_JAM1,0
  156.     dc.w    (\3-(AG_T_String\@_End-AG_T_String\@-1)*8)/2+1,((\4-8)/2)+1
  157.     dc.l    TOPAZ_80,AG_T_String\@,AG_Text2_\@
  158.  
  159. AG_Text2_\@    dc.b    \6,0,RP_JAM1,0
  160.     dc.w    (\3-(AG_T_String\@_End-AG_T_String\@-1)*8)/2),(\4-8)/2
  161.     dc.l    TOPAZ_80,AG_T_String\@,0
  162.  
  163.     
  164.     IFEQ    FontFlag
  165.  
  166. TOPAZ_80    dc.l    T_80name
  167.     dc.w    TOPAZ_EIGHTY
  168.     dc.b    FS_NORMAL,FPF_ROMFONT
  169.     even
  170. T_80name    dc.b    "topaz.font",0
  171.  
  172. FontFlag    set    1
  173.     endc
  174.     endm
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.     include    "misc/easystart.i"
  182.     
  183.     clr.l    _ColorBase
  184.     clr.l    _XColorBase
  185.     bsr    OpenThem
  186.     move.l    _ARPBase(pc),a1    
  187.     cmp.l    #0,a1
  188.     beq.s    .L1
  189.     CALLEXEC    CloseLibrary
  190. .L1    move.l    _ColorBase(pc),a1    
  191.     cmp.l    #0,a1
  192.     beq.s    .L2
  193.     CALLEXEC    CloseLibrary
  194. .L2    rts    
  195.  
  196.  
  197. OpenThem    lea    dosname(pc),a1        ; open libs
  198.     moveq.l    #0,d0
  199.     CALLEXEC     OpenLibrary
  200.     move.l    d0,_DOSBase    
  201.     lea    intname(pc),a1                 
  202.     moveq.l    #0,d0        
  203.     CALLEXEC     OpenLibrary
  204.     move.l    d0,_IntuitionBase  
  205.     lea    grafname(pc),a1
  206.     moveq.l    #0,d0
  207.     CALLEXEC     OpenLibrary
  208.     move.l    d0,_GfxBase
  209.     
  210.     lea    xcolorname(pc),a1    ; try to use XColor.lib
  211.     moveq.l    #0,d0
  212.     CALLEXEC     OpenLibrary
  213.     move.l    d0,_XColorBase
  214.     bne.s    .L1    
  215.     lea    colorname(pc),a1    ; if failed, try to use Color.lib
  216.     moveq.l    #0,d0
  217.     CALLEXEC     OpenLibrary
  218.     move.l    d0,_ColorBase
  219.     tst.l    d0
  220.     bne.s    .L1
  221.     or.w    #GADGDISABLED,GadgetV2_33+gg_Flags
  222. .L1    lea    arpname(pc),a1
  223.     moveq.l    #0,d0
  224.     CALLEXEC     OpenLibrary
  225.     move.l    d0,_ARPBase
  226.     tst.l    d0
  227.     bne    Init
  228.     move.l    #RECOVERY_ALERT,d0    ; error message
  229.     move.l    #30,d1
  230.     lea.l    NoARPText(pc),a0
  231.     CALLINT    DisplayAlert
  232.     moveq.l    #0,d0
  233.     rts
  234. NoARPText    dc.w    60
  235.     dc.b    17
  236.     dc.b    "FENSTER  :   ERROR !?!    I cannot open the ARP LIBRARY !"
  237.     dc.b     0,0
  238.  
  239.     rts
  240.  
  241. _DOSBase    dc.l    0
  242. dosname    DOSNAME
  243. _GfxBase    dc.l    0
  244. grafname    GRAFNAME
  245. _IntuitionBase    dc.l    0
  246. intname    INTNAME
  247. _XColorBase    dc.l    0
  248. xcolorname    XCOLORNAME
  249. arpname    dc.b    "arp.library",0
  250.     even
  251. _ARPBase    dc.l    0
  252. colorname    dc.b    "color.library",0
  253.     even
  254. _ColorBase    dc.l    0
  255.  
  256. CloseThem    move.l    _DOSBase(pc),a1    ; close libs
  257.     CALLEXEC    CloseLibrary
  258.     move.l    _GfxBase(pc),a1
  259.     CALLEXEC    CloseLibrary
  260.     move.l    _IntuitionBase(pc),a1
  261.     CALLEXEC    CloseLibrary
  262.     move.l    _ARPBase(pc),a1    
  263.     cmp.l    #0,a1
  264.     beq.s    .L1
  265.     CALLEXEC    CloseLibrary
  266. .L1    move.l    _ColorBase(pc),a1    
  267.     cmp.l    #0,a1
  268.     beq.s    .L2
  269.     CALLEXEC    CloseLibrary
  270. .L2    move.l    _XColorBase(pc),a1    
  271.     cmp.l    #0,a1
  272.     beq.s    .L3
  273.     CALLEXEC    CloseLibrary
  274. .L3    rts    
  275.  
  276. Window1    dc.l    0
  277. Palette    dc.w    $443,$eee,$002,$f80
  278.  
  279. Start    lea.l    Screendef(pc),a0    ; open Screen
  280.     CALLINT    OpenScreen
  281.     tst.l    d0
  282.     beq    ende
  283.     move.l    d0,ScreenPtr1
  284.  
  285.     move.l    d0,a0        ; set colours
  286.     lea.l    sc_ViewPort(a0),a0
  287.     moveq.l    #4,d0
  288.     lea.l    Palette(pc),a1
  289.     CALLGRAF    LoadRGB4
  290.     CALLINT    RemakeDisplay
  291.  
  292.  
  293.     lea.l    Windowdef1(pc),a0        ; open window    
  294.     CALLINT    OpenWindow
  295.     tst.l    d0
  296.     beq    QUIT2
  297.     move.l    d0,Window1
  298.  
  299.     
  300. WindowPointer set Window1        ;define Window1 as WindowPointer (for macros )
  301.  
  302.  
  303.     SETDRMD    #RP_JAM1
  304.     
  305.  
  306. ChangeScreen    SETAPEN    #0
  307.     RECTFILL    #10+184,#10,#270+184,#165
  308.  
  309.     clr.l    Mode        ; mode = select Screen
  310.     bsr    ShowScreen        ; Select Screen
  311.  
  312.     lea.l    Gadget1(pc),a0        
  313.     move.l    Window1(pc),a1
  314.     sub.l    a2,a2
  315.     CALLINT    RefreshGadgets
  316.  
  317.  
  318.  
  319. wait    move.l    Window1(pc),a0        ; wait .....
  320.     move.l    wd_UserPort(a0),a0
  321.     move.l    a0,a5
  322.     CALLEXEC    WaitPort        
  323.     move.l    a5,a0
  324.     CALLEXEC    GetMsg        ; get message
  325.     move.l    d0,a1    
  326.     move.l    im_Class(a1),d4    ; get data
  327.     move.w    im_Code(a1),d5
  328.     move.l    im_IAddress(a1),a4
  329.     moveq.l    #0,d6
  330.     move.w    im_MouseY(a1),d6
  331.     CALLEXEC     ReplyMsg        ; reply message        
  332.     cmp.l    #MOUSEBUTTONS,d4
  333.     bne.s    .Goon
  334.     cmp.w    #MENUDOWN,d5
  335.     beq    QUIT
  336. .Goon    cmp.l    #VANILLAKEY,d4
  337.     beq    KEY
  338.  
  339.     moveq.l    #0,d0        ; use table to get subroutine        
  340.     move.w    gg_GadgetID(a4),d0
  341.     subq    #1,d0
  342.     lsl.l    #2,d0
  343.     lea.l    Vektoren(pc),a0
  344.     tst.l    Mode
  345.     bne    modus2    
  346.     lea.l    VektorenScreen(pc),a0
  347. modus2    move.l    (a0,d0),a0
  348.     jmp    (a0)
  349. Vektoren    dc.l    ChangeScreen,GetWindows,KillWindow,FRONT,BACK    ; 1
  350.     dc.l    CLEAR,FRAME,ALL,REFRESH,IDCMP            ; 6
  351.     dc.l    ABOUT,NewLimits,NewLimits,NewLimits,NewLimits    ; 11
  352.     dc.l    NewPen,MoveWindow,MoveWindow,SizeWindow,SizeWindow    ; 16
  353.     dc.l    NewPen,WindowSelect,PrintWindow,SaveWindow,ALL    ; 21
  354.     dc.l    wait,ScreenFRONT,ScreenBACK,SaveScreen,PrintScreen    ; 26
  355.     dc.l    ADD,SUB,ColReq,TOP,wait            ; 31
  356.     dc.l    wait,wait,wait,wait,wait
  357.  
  358. VektorenScreen    dc.l    ChangeScreen,ChangeScreen,Error,Error,Error
  359.     dc.l    Error,Error,Error,Error,Error
  360.     dc.l    ABOUT,Error,Error,Error,Error
  361.     dc.l    Error,Error,Error,Error,Error
  362.     dc.l    Error,ScreenSelect,wait,wait
  363.     dc.l    Error,Error,Error,Error,Error
  364.     dc.l    Error,Error,Error,Error,Error
  365.     dc.l    Error,Error,Error,Error,Error
  366.     
  367. Error    move.l    ScreenPtr1(pc),a0
  368.     CALLINT    DisplayBeep
  369.     bra    wait
  370.  
  371.  
  372.     
  373. QUIT    move.l    Window1(pc),a0        ; bye, bye !
  374.     CALLINT    CloseWindow
  375.  
  376.     move.l    ScreenPtr1(pc),a0
  377.     CALLINT    CloseScreen
  378.  
  379.     moveq.l    #0,d0
  380.     rts
  381.  
  382. KEY    cmp.b    #"f",d5        ; useful key pressed ?
  383.     beq    KEY2
  384.     cmp.b    #"s",d5
  385.     bne    KEY3
  386.     tst.l    Mode
  387.     beq    wait
  388.  
  389.     move.l    BILDSCHIRM(pc),a0
  390.     CALLINT    ScreenToFront
  391.     bra    wait
  392.  
  393. KEY2    move.l    ScreenPtr1(pc),a0
  394.     CALLINT    ScreenToFront
  395.     bra    wait
  396.  
  397. KEY3    cmp.b    #"u",d5
  398.     beq    UP
  399.     cmp.b    #"d",d5
  400.     bne    wait
  401.     move.l    Top,d0    ; move down
  402.     add.l    #17,d0
  403.     cmp.l    Anzahl,d0
  404.     bge    wait
  405.     add.l    #1,Top
  406.     bra    ShowWindow
  407.  
  408.  
  409. UP    tst.l    Top    ; move up
  410.     beq    wait
  411.     sub.l    #1,Top
  412.     bra    ShowWindow
  413.     
  414.     
  415.  
  416.  
  417. Mode    dc.l    0
  418.  
  419.  
  420. Screendef    dc.w    0,0,640,199,2
  421.     dc.b    0,1
  422.     dc.w    V_HIRES
  423.     dc.w    CUSTOMSCREEN
  424.     dc.l    TOPAZ_80
  425.     dc.l    S_Title,0,0
  426.     
  427.  
  428. Windowdef1    dc.w    0,0,640,199
  429.     dc.b    -1,-1
  430.     dc.l    GADGETUP!MOUSEBUTTONS!VANILLAKEY
  431.     dc.l    WINDOWDRAG!WINDOWCLOSE!ACTIVATE!SMART_REFRESH!BACKDROP!RMBTRAP
  432.     dc.l    GadgetV2_1
  433.     dc.l    0
  434.     dc.l    0
  435. ScreenPtr1    dc.l    0,0
  436.     dc.w    0,0,0,0,CUSTOMSCREEN
  437. S_Title    dc.b    "RF-Tools : FENSTER V2.2 by Roger Fischlin April/1990            ",0
  438.     even
  439.  
  440. Gadget1    AUTOGADGET     10,13+0*14,165,10,3,1,<"Show Screens">,1,Gadget2
  441.     even
  442. Gadget2    AUTOGADGET     10,13+1*14,165,10,3,1,<"Update List">,2,Gadget3
  443.     even
  444. Gadget3    AUTOGADGET     280+184,13+2*14,165,10,3,1,<"Close Window">,3,Gadget4
  445.     even
  446. Gadget4    AUTOGADGET     280+184,13+3*14,165,10,3,1,<"Window To Front">,4,Gadget5
  447.     even
  448. Gadget5    AUTOGADGET     280+184,13+4*14,165,10,3,1,<"Window To Back">,5,Gadget6
  449.     even
  450. Gadget6    AUTOGADGET     280+184,13+5*14,165,10,3,1,<"Clear Pointer">,6,Gadget7
  451.     even
  452. Gadget7    AUTOGADGET     280+184,13+6*14,165,10,3,1,<"Redraw Frame">,7,Gadget9
  453.     even
  454. Gadget9    AUTOGADGET     280+184,13+7*14,165,10,3,1,<"Refresh Gadgets">,9,Gadget10
  455.     even
  456. Gadget10    AUTOGADGET     280+184,13+8*14,165,10,3,1,<"Modify IDCMP">,10,Gadget11
  457.     even
  458. Gadget11    AUTOGADGET     280+184,13+9*14+7,165,10,1,3,<"About Fenster">,11,Gadget12
  459.     even
  460.  
  461.  
  462.  
  463. Gadget12    dc.l    Gadget13
  464.     dc.w    55+184,185+3,41,12
  465.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  466.     dc.l    G12_box
  467.     dc.l    0,G12_Text,0,G12_Info
  468.     dc.w    12,0,0
  469. G12_box    BOX    -5,-4,36,12,1,G12_Box2
  470.     even
  471. G12_Box2    BOX    -5,-4,-55,12,1,0
  472.     even
  473. G12_Text    TEXT    -50,0,3,<"min.X">
  474.     even
  475. G12_Info    dc.l    G12_Puffer,G12_Undo
  476.     dc.w    0,4
  477.     ds.b    si_SIZEOF
  478. G12_Puffer    ds.b    6
  479. G12_Undo    ds.b    6
  480.  
  481. Gadget13    dc.l    Gadget14
  482.     dc.w    5*8+150-45+1+184,185+3,41,12
  483.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  484.     dc.l    G12_box
  485.     dc.l    0,G13_Text,0,G13_Info
  486.     dc.w    13,0,0
  487.     even
  488. G13_Text    TEXT    -50,0,3,<"min.Y">
  489.     even
  490. G13_Info    dc.l    G13_Puffer,G13_Undo
  491.     dc.w    0,4
  492.     ds.b    si_SIZEOF
  493. G13_Puffer    ds.b    6
  494. G13_Undo    ds.b    6
  495.  
  496. Gadget14    dc.l    Gadget15
  497.     dc.w    5*8+250-10-45+2+184,185+3,41,12
  498.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  499.     dc.l    G12_box
  500.     dc.l    0,G14_Text,0,G14_Info
  501.     dc.w    14,0,0
  502.     even
  503. G14_Text    TEXT    -50,0,3,<"max.X">
  504.     even
  505. G14_Info    dc.l    G14_Puffer,G14_Undo
  506.     dc.w    0,4
  507.     ds.b    si_SIZEOF
  508. G14_Puffer    ds.b    6
  509. G14_Undo    ds.b    6
  510.  
  511. Gadget15    dc.l    Gadget16
  512.     dc.w    5*8+350-20-45+3+184,185+3,41,12
  513.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  514.     dc.l    G12_box
  515.     dc.l    0,G15_Text,0,G15_Info
  516.     dc.w    15,0,0
  517.     even
  518. G15_Text    TEXT    -53,0,3,<"max.Y">
  519.     even
  520. G15_Info    dc.l    G15_Puffer,G15_Undo
  521.     dc.w    0,4
  522.     ds.b    si_SIZEOF
  523. G15_Puffer    ds.b    6
  524. G15_Undo    ds.b    6
  525. Gadget16    dc.l    Gadget17
  526.     dc.w    5*8+450-30-45+4+184,185+3,41,12
  527.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  528.     dc.l    G16_box
  529.     dc.l    0,G16_Text,0,G16_Info
  530.     dc.w    16,0,0
  531.     even
  532. G16_box    BOX    -5,-4,35,12,1,G16_Box2
  533.     even
  534. G16_Box2    BOX    -5,-4,-55,12,1,0
  535.     even
  536. G16_Text    TEXT    -50,0,3,<"BPen">
  537.     even
  538. G16_Info    dc.l    G16_Puffer,G16_Undo
  539.     dc.w    0,3
  540.     ds.b    si_SIZEOF
  541. G16_Puffer    ds.b    6
  542. G16_Undo    ds.b    6
  543.  
  544. Gadget17    dc.l    Gadget18
  545.     dc.w    55+184,185+3-16,41,12
  546.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  547.     dc.l    G12_box
  548.     dc.l    0,G17_Text,0,G17_Info
  549.     dc.w    17,0,0
  550. G17_Text    TEXT    -50,0,3,<"X">
  551.     even
  552. G17_Info    dc.l    G17_Puffer,G17_Undo
  553.     dc.w    0,4
  554.     ds.b    si_SIZEOF
  555. G17_Puffer    ds.b    6
  556. G17_Undo    ds.b    6
  557.  
  558. Gadget18    dc.l    Gadget19
  559.     dc.w    5*8+150-45+1+184,185+3-16,41,12
  560.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  561.     dc.l    G12_box
  562.     dc.l    0,G18_Text,0,G18_Info
  563.     dc.w    18,0,0
  564.     even
  565. G18_Text    TEXT    -50,0,3,<"Y">
  566.     even
  567. G18_Info    dc.l    G18_Puffer,G18_Undo
  568.     dc.w    0,4
  569.     ds.b    si_SIZEOF
  570. G18_Puffer    ds.b    6
  571. G18_Undo    ds.b    6
  572.  
  573. Gadget19    dc.l    Gadget20
  574.     dc.w    5*8+250-10-45+2+184,185+3-16,41,12
  575.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  576.     dc.l    G12_box
  577.     dc.l    0,G19_Text,0,G19_Info
  578.     dc.w    19,0,0
  579.     even
  580. G19_Text    TEXT    -50,0,3,<"Width">
  581.     even
  582. G19_Info    dc.l    G19_Puffer,G19_Undo
  583.     dc.w    0,4
  584.     ds.b    si_SIZEOF
  585. G19_Puffer    ds.b    6
  586. G19_Undo    ds.b    6
  587.  
  588. Gadget20    dc.l    Gadget21
  589.     dc.w    5*8+350-20-45+3+184,185+3-16,41,12
  590.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  591.     dc.l    G12_box
  592.     dc.l    0,G20_Text,0,G20_Info
  593.     dc.w    20,0,0
  594.     even
  595. G20_Text    TEXT    -53,0,3,<"Height">
  596.     even
  597. G20_Info    dc.l    G20_Puffer,G20_Undo
  598.     dc.w    0,4
  599.     ds.b    si_SIZEOF
  600. G20_Puffer    ds.b    6
  601. G20_Undo    ds.b    6
  602. Gadget21    dc.l    0    
  603.     dc.w    5*8+450-30-45+4+184,185+3-16,41,12
  604.     dc.w    GADGHCOMP,RELVERIFY!LONGINT,STRGADGET
  605.     dc.l    G16_box
  606.     dc.l    0,G21_Text,0,G21_Info
  607.     dc.w    21,0,0
  608.     even
  609. G21_Text    TEXT    -50,0,3,<"DPen">
  610.     even
  611. G21_Info    dc.l    G21_Puffer,G21_Undo
  612.     dc.w    0,3
  613.     ds.b    si_SIZEOF
  614. G21_Puffer    ds.b    6
  615. G21_Undo    ds.b    6
  616.     even
  617. GadgetV2_1
  618. Gadget22    dc.l    GadgetV2_23
  619.     dc.w    10+184,32-6,240+16,128+8
  620.     dc.w    GADGHNONE,RELVERIFY!LONGINT,BOOLGADGET
  621.     dc.l    0
  622.     dc.l    0,0,0,0
  623.     dc.w    22,0,0
  624.     even
  625.  
  626.  
  627. GadgetV2_23    AUTOGADGET     280+184,13+0*14,165,10,3,1,<"Print Window">,23,GadgetV2_24
  628.     even
  629. GadgetV2_24    AUTOGADGET     280+184,13+1*14,165,10,3,1,<"Save Window">,24,GadgetV2_25
  630.     even
  631. GadgetV2_25    AUTOGADGET     10,13+2*14,165,10,3,1,<"Close Screen">,25,GadgetV2_27
  632.     even
  633. GadgetV2_27    AUTOGADGET     10,13+3*14,165,10,3,1,<"Screen To Front">,27,GadgetV2_28
  634.     even
  635. GadgetV2_28    AUTOGADGET     10,13+4*14,165,10,3,1,<"Screen To Back">,28,GadgetV2_29
  636.     even
  637. GadgetV2_29    AUTOGADGET     10,13+5*14,165,10,3,1,<"Save Screen">,29,GadgetV2_30
  638.     even
  639. GadgetV2_30    AUTOGADGET     10,13+6*14,165,10,3,1,<"Print Screen">,30,GadgetV2_31
  640.     even
  641. GadgetV2_31    AUTOGADGET     10,13+7*14,165,10,3,1,<"Add Bitplane">,31,GadgetV2_32
  642.     even
  643. GadgetV2_32    AUTOGADGET     10,13+8*14,165,10,3,1,<"Sub Bitplane">,32,GadgetV2_33
  644.     even
  645. GadgetV2_33    AUTOGADGET     10,13+10*14,165,10,3,1,<"Colour Requester">,33,GadgetV2_34
  646.     even
  647. GadgetV2_34    AUTOGADGET     10,13+9*14,165,10,3,1,<"Move To Left Edge">,34,Gadget1
  648.     even
  649.  
  650.  
  651.  
  652. Windowdef3    dc.w    (640-300)/2,25,300,120
  653.     dc.b    -1,-1
  654.     dc.l    GADGETUP
  655.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  656.     dc.l    Gadget_About
  657.     dc.l    0
  658.     dc.l    W3_Title
  659.     dc.l    0,0
  660.     dc.w    0,0,0,0,CUSTOMSCREEN
  661. W3_Title    dc.b    "        » ABOUT  FENSTER «           ",0
  662.     even
  663. Gadget_About    AUTOGADGET     20,100,260,12,3,1,<"Exit">,0,0
  664.     even
  665.  
  666.  
  667.  
  668. Window2    dc.l    0
  669.  
  670.  
  671. ABOUT    lea.l    Windowdef3(pc),a0    ; about FENSTER
  672.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  673.     CALLINT    OpenWindow
  674.     tst.l    d0
  675.     beq    wait
  676.     move.l    d0,Window2
  677.  
  678. WindowPointer set Window2
  679.  
  680.     SETAPEN    #2
  681.     RECTFILL    #2,#10,#297,#118
  682.  
  683.     SETDRMD    #RP_JAM1
  684.     WRITE    #6+((290-23*8)/2),#20+1,#0,<"RF-Tools : FENSTER V2.2">
  685.     WRITE    #6+((290-31*8)/2),#29+1,#0,<"This utility is public domain !">
  686.     WRITE    #6+((290-24*8)/2),#40+1,#0,<"by: Roger Fischlin  ">
  687.     WRITE    #6+((290-24*8)/2),#49+1,#0,<"    Steigerwaldweg 6">
  688.     WRITE    #6+((290-24*8)/2),#58+1,#0,<"    D-6450 Hanau 7">
  689.     WRITE    #6+((290-24*8)/2),#67+1,#0,<"    West Germany">
  690.     WRITE    #6+((290-32*8)/2),#86+1,#0,<"How about reading the doc file ?">
  691.  
  692.  
  693.     WRITE    #5+((290-23*8)/2),#20,#1,<"RF-Tools : FENSTER V2.2">
  694.     WRITE    #5+((290-31*8)/2),#29,#1,<"This utility is public domain !">
  695.     WRITE    #5+((290-24*8)/2),#40,#3,<"by: Roger Fischlin  ">
  696.     WRITE    #5+((290-24*8)/2),#49,#3,<"    Steigerwaldweg 6">
  697.     WRITE    #5+((290-24*8)/2),#58,#3,<"    D-6450 Hanau 7">
  698.     WRITE    #5+((290-24*8)/2),#67,#3,<"    West Germany">
  699.     WRITE    #5+((290-32*8)/2),#86,#1,<"How about reading the doc file ?">
  700.     
  701.     lea.l    Gadget_About(pc),a0
  702.     move.l    Window2(pc),a1
  703.     sub.l    a2,a2
  704.     CALLINT    RefreshGadgets
  705.  
  706.  
  707.     move.l    Window2(pc),a0        
  708.     move.l    wd_UserPort(a0),a0
  709.     CALLEXEC    WaitPort
  710.  
  711.     move.l    Window2(pc),a0
  712.     CALLINT    CloseWindow
  713.     bra    wait
  714.  
  715.  
  716. Zeile    dc.b    "                   ... x ..  x .    ",0
  717.  
  718.     even
  719.  
  720.  
  721. * Ask User to select screen .... 
  722.     
  723. WindowPointer set Window1
  724.  
  725.  
  726. ShowScreen    moveq.l    #0,d0
  727.     move.b    d0,G12_Puffer
  728.     move.b    d0,G13_Puffer
  729.     move.b    d0,G14_Puffer
  730.     move.b    d0,G15_Puffer
  731.     move.b    d0,G16_Puffer
  732.     move.b    d0,G17_Puffer
  733.     move.b    d0,G18_Puffer
  734.     move.b    d0,G19_Puffer
  735.     move.b    d0,G20_Puffer
  736.     move.b    d0,G21_Puffer
  737.  
  738.     lea.l    Gadget12(pc),a0        
  739.     move.l    Window1(pc),a1
  740.     sub.l    a2,a2
  741.     CALLINT    RefreshGadgets
  742.  
  743.  
  744.     WRITE    #10+184,#20,#2,<"        Select Screen">
  745.     WRITE    #11+184,#19,#1,<"        Select Screen">
  746.     WRITE    #10+184,#26,#2,<"--------------------------------">
  747.     WRITE    #11+184,#25,#1,<"--------------------------------">
  748.     
  749.     SETAPEN    #3
  750.     moveq.l    #0,d5        ; get pointer to first screen
  751.     move.l    _IntuitionBase,a6
  752.     move.l    ib_FirstScreen(a6),a5
  753.     lea.l    Pointer(pc),a3
  754.     clr.l    Anzahl
  755.     clr.l    Top
  756.  
  757. .SS1    move.l    sc_DefaultTitle(a5),a4    ; get screen title
  758.     lea.l    Zeile(pc),a0        ; up to 32 characters
  759.     move.b    #"?",(a0)+
  760.     move.l    #30,d0
  761. .SS5    move.b    #" ",(a0)+
  762.     dbra    d0,.SS5
  763.     move.b    #"x",Zeile+59-32-4
  764.     move.b    #"x",Zeile+63-32-2
  765.     
  766.     lea.l    Zeile(pc),a0
  767.  
  768. .SS2    tst.b    (a4)        ; leave out spaces
  769.     beq    .SS3
  770.     cmp.b    #" ",(a4)+
  771.     beq    .SS2
  772.     tst.b    -(a4)
  773.     beq    .SS3
  774.     move.l    #21,d0
  775. .SS4    move.b    (a4)+,d1
  776.     beq    .SS3
  777.     move.b    d1,(a0)+
  778.     dbra    d0,.SS4
  779.  
  780. .SS3    moveq.l    #0,d0        ; write screen width & height
  781.     move.w    sc_Width(a5),d0
  782.     lea.l    Zeile+54-32-4(pc),a0
  783.     bsr    MakeZahl    
  784.     moveq.l    #0,d0
  785.     move.w    sc_Height(a5),d0
  786.     lea.l    Zeile+60-32-4,a0
  787.     bsr    MakeZahl    
  788.     lea.l    sc_BitMap(a5),a0
  789.     move.b    bm_Depth(a0),d0
  790.     add.b    #"0",d0
  791.     move.b    d0,Zeile+63-32    
  792.         
  793.  
  794.  
  795.     move.l    Window1(pc),a1        
  796.     move.l    wd_RPort(a1),a1
  797.     move.l    #10+184,d0
  798.     move.l    d5,d1
  799.     lsl.l    #3,d1
  800.     add.l    #32,d1
  801.     CALLGRAF    Move
  802.     lea.l    Zeile(pc),a0
  803.     move.l    Window1(pc),a1
  804.     move.l    wd_RPort(a1),a1
  805.     move.l    #33,d0
  806.     CALLGRAF    Text
  807.     addq.l    #1,Anzahl
  808.     
  809.     move.l    a5,(a3)+        ; any more screens ?
  810.     move.l    (a5),a5
  811.     cmp.l    #0,a5
  812.     beq    .SS6
  813.     
  814.     addq    #1,d5
  815.     cmp.w    #14,d5        ; up to 14 screens (DID YOU HAVE HAD MORE THAN 14 SCREENS ?!?)
  816.     bne    .SS1
  817. .SS6    rts
  818.  
  819. Top    dc.l    0        ; nummer of first pointer on display
  820. Anzahl    dc.l    0        ; number of pointers displayed
  821. FENSTER    dc.l    0        ; pointer to current window
  822. BILDSCHIRM    dc.l    0        ; pointer to current screen
  823. Pointer    ds.l    20*5        ; array containing the window pointers 
  824.  
  825.  
  826. MakeZahl    moveq.l    #3,d2        ; convert number (<1024)  into ASCII text 
  827.     moveq.l    #0,d3
  828.     lea.l    .Potenzen(pc),a1
  829. .MZ1    move.b    #"0"-1,d1
  830. .MZ2    addq    #1,d1
  831.     sub.l    (a1),d0
  832.     bcc.s    .MZ2
  833.     add.l    (a1)+,d0
  834.     tst.b    d2
  835.     beq.s    .MZ3
  836.     cmp.b    #"0",d1
  837.     beq.s    .MZ4
  838.     moveq.l    #1,d3
  839.     bra.s    .MZ3
  840. .MZ4    tst.b    d3
  841.     bne.s    .MZ3
  842.     move.b    #" ",d1
  843. .MZ3    move.b    d1,(a0)+
  844.     dbra    d2,.MZ1
  845.     rts
  846. .Potenzen    dc.l    1000
  847.     dc.l    100
  848.     dc.l    10
  849.     dc.l    1
  850.  
  851. MakeZahl3    moveq.l    #2,d2    ; convert number (<1000)  into ASCII text
  852.     moveq.l    #0,d3
  853.     lea.l    .Potenzen(pc),a1
  854. .MZ1    move.b    #"0"-1,d1
  855. .MZ2    addq    #1,d1
  856.     sub.l    (a1),d0
  857.     bcc.s    .MZ2
  858.     add.l    (a1)+,d0
  859.     tst.b    d2
  860.     beq.s    .MZ3
  861.     cmp.b    #"0",d1
  862.     beq.s    .MZ4
  863.     moveq.l    #1,d3
  864.     bra    .MZ3
  865. .MZ4    tst.b    d3
  866.     beq.s    .MZ5
  867. .MZ3    move.b    d1,(a0)+
  868. .MZ5    dbra    d2,.MZ1
  869.     clr.b    (a0)
  870.     rts
  871. .Potenzen    dc.l    100
  872.     dc.l    10
  873.     dc.l    1
  874.  
  875. MakeZahl2    moveq.l    #1,d2    ; convert number (<99)  into ASCII text
  876.     moveq.l    #0,d3
  877.     lea.l    .Potenzen(pc),a1
  878. .MZ1    move.b    #"0"-1,d1
  879. .MZ2    addq    #1,d1
  880.     sub.l    (a1),d0
  881.     bcc.s    .MZ2
  882.     add.l    (a1)+,d0
  883.     tst.b    d2
  884.     beq.s    .MZ3
  885.     cmp.b    #"0",d1
  886.     beq    .MZ4
  887.     moveq.l    #1,d3
  888.     bra.s    .MZ3
  889. .MZ4    tst.b    d3
  890.     beq.s    .MZ5
  891. .MZ3    move.b    d1,(a0)+
  892. .MZ5    dbra    d2,.MZ1
  893.     clr.b    (a0)
  894.     rts
  895. .Potenzen    dc.l    10
  896.     dc.l    1
  897.  
  898. GetLine    sub.w    gg_TopEdge(a4),d6    ; calculate which screen / window was selected  
  899.     lsr.w    #3,d6
  900.     and.l    #$ffff,d6
  901.     move.l    Anzahl(pc),d0
  902.     add.l    Top,d6
  903.     cmp.l    d0,d6
  904.     bge    .GetLine1
  905.     lea.l    Pointer(pc),a0
  906.     lsl.l    #2,d6
  907.     move.l    (a0,d6),a0        ; a0 contains pointer
  908.     moveq.l    #0,d0
  909.     rts
  910. .GetLine1    moveq.l    #-1,d0        ; error - user selected space
  911.     rts
  912.  
  913. ScreenSelect    bsr    GetLine        ; list windows of selected screen    
  914.     tst.l    d0
  915.     bne    wait
  916.     move.l    a0,a5
  917.     move.l    a5,BILDSCHIRM
  918.     
  919.     SETAPEN    #0
  920.     RECTFILL    #10+184,#10,#270+184,#165
  921.     WRITE    #10+184,#26,#2,<"--------------------------------">
  922.     WRITE    #11+184,#25,#1,<"--------------------------------">
  923.     
  924. .SS1    move.l    sc_DefaultTitle(a5),a4    ; get screen title
  925.     lea.l    Zeile(pc),a0        ; up to 32 characters
  926.     move.b    #"?",(a0)+
  927.     move.w    #30,d0
  928. .SS5    move.b    #" ",(a0)+
  929.     dbra    d0,.SS5
  930.     move.b    #"x",Zeile+59-32-4
  931.     move.b    #"x",Zeile+63-32-2
  932.     
  933.     lea.l    Zeile(pc),a0
  934.  
  935. .SS2    tst.b    (a4)        ; leave out spaces
  936.     beq.s    .SS3
  937.     cmp.b    #" ",(a4)+
  938.     beq.s    .SS2
  939.     tst.b    -(a4)
  940.     beq.s    .SS3
  941.     move.l    #21,d0
  942. .SS4    move.b    (a4)+,d1
  943.     beq.s    .SS3
  944.     move.b    d1,(a0)+
  945.     dbra    d0,.SS4
  946.  
  947. .SS3    moveq.l    #0,d0        ; write screen width & height
  948.     move.w    sc_Width(a5),d0
  949.     lea.l    Zeile+54-32-4(pc),a0
  950.     bsr    MakeZahl    
  951.     moveq.l    #0,d0
  952.     move.w    sc_Height(a5),d0
  953.     lea.l    Zeile+60-32-4(pc),a0
  954.     bsr    MakeZahl    
  955.     lea.l    sc_BitMap(a5),a0
  956.     move.b    bm_Depth(a0),d0
  957.     add.b    #"0",d0
  958.     move.b    d0,Zeile+63-32    
  959.             
  960.  
  961.     SETAPEN    #2
  962.     move.l    Window1(pc),a1
  963.     move.l    wd_RPort(a1),a1
  964.     move.w    #10+1+184,d0
  965.     move.w    #19+1,d1
  966.     CALLGRAF    Move
  967.     lea.l    Zeile(pc),a0
  968.     move.l    Window1(pc),a1
  969.     move.l    wd_RPort(a1),a1
  970.     move.l    #33,d0
  971.     CALLGRAF    Text
  972.     
  973.     SETAPEN    #1
  974.     move.l    Window1(pc),a1
  975.     move.l    wd_RPort(a1),a1
  976.     move.w    #10+184,d0
  977.     move.w    #19,d1
  978.     CALLGRAF    Move
  979.     lea.l    Zeile(pc),a0
  980.     move.l    Window1(pc),a1
  981.     move.l    wd_RPort(a1),a1
  982.     move.l    #33,d0
  983.     CALLGRAF    Text
  984.  
  985.     move.l    #1,Mode
  986.  
  987.  
  988. GetWindows    SETAPEN    #0        ; store all windows on the screen in array and print their names 
  989.     RECTFILL    #10+184,#25,#270+184,#165
  990.     move.l    BILDSCHIRM(pc),a5
  991.     clr.l    FENSTER        
  992.     lea.l    Pointer(pc),a1
  993.     move.l    #20*5,d0
  994.     clr.l    Top
  995.     clr.l    Anzahl
  996.     clr.l    Pointer
  997.     move.l    sc_FirstWindow(a5),a5
  998. .Loop    cmp.l    #0,a5
  999.     beq.s    .Loop2
  1000. .Loop3    move.l    a5,(a1)+
  1001.     addq.l    #1,Anzahl
  1002.     move.l    (a5),a5
  1003.     dbra    d0,.Loop
  1004. .Loop2    move.l    Pointer(pc),FENSTER    ; define first window as already selected
  1005.  
  1006.     bsr    FillIn        ; Fill in the gadgets on the bottom
  1007.  
  1008. ShowWindow    SETAPEN    #3
  1009.     SETBPEN    #0
  1010.     SETDRMD    #RP_JAM2
  1011.  
  1012.     move.l    Window1(pc),a1
  1013.     move.l    wd_RPort(a1),a1
  1014.     move.w    #10+184,d0
  1015.     move.w    #32,d1
  1016.     CALLGRAF    Move
  1017.     lea.l    ClearZeile(pc),a0
  1018.     move.l    Window1(pc),a1
  1019.     move.l    wd_RPort(a1),a1
  1020.     move.l    #32,d0
  1021.     CALLGRAF    Text
  1022.  
  1023.  
  1024.     moveq.l    #0,d5
  1025.     lea.l    Pointer(pc),a3
  1026.     move.l    Top(pc),d4
  1027.     lsl.l    #2,d4
  1028.     add.l    d4,a3
  1029.  
  1030. .SS1    move.l    d5,d0
  1031.     add.l    Top(pc),d0
  1032.     cmp.l    Anzahl(pc),d0
  1033.     bge    .SS6
  1034.     
  1035.     SETBPEN    #0
  1036.     move.l    (a3)+,a5
  1037.     cmp.l    FENSTER(pc),a5
  1038.     bne    .SS0
  1039.     SETBPEN    #2
  1040.  
  1041. .SS0    move.l    wd_Title(a5),a4    ; title up to 31 characters
  1042.     lea.l    Zeile(pc),a0
  1043.     move.b    #"?",(a0)+
  1044.     move.w    #30,d0
  1045. .SS5    move.b    #" ",(a0)+
  1046.     dbra    d0,.SS5
  1047.     lea.l    Zeile(pc),a0
  1048.  
  1049. .SS2    tst.b    (a4)
  1050.     beq.s    .SS3
  1051.     cmp.b    #" ",(a4)+
  1052.     beq.s    .SS2
  1053.     tst.b    -(a4)
  1054.     beq.s    .SS3
  1055.     move.l    #31,d0
  1056. .SS4    move.b    (a4)+,d1
  1057.     beq.s    .SS3
  1058.     move.b    d1,(a0)+
  1059.     dbra    d0,.SS4
  1060.  
  1061. .SS3    
  1062.     move.l    Window1(pc),a1
  1063.     move.l    wd_RPort(a1),a1
  1064.     move.l    #10+184,d0
  1065.     move.l    d5,d1
  1066.     lsl.w    #3,d1
  1067.     add.w    #32,d1
  1068.     CALLGRAF    Move
  1069.     lea.l    Zeile(pc),a0
  1070.     move.l    Window1(pc),a1
  1071.     move.l    wd_RPort(a1),a1
  1072.     move.l    #32,d0
  1073.     CALLGRAF    Text
  1074.  
  1075.     addq    #1,d5
  1076.     cmp.w    #17,d5
  1077.     bne    .SS1
  1078. .SS6    SETDRMD    #RP_JAM1
  1079.     bra    wait
  1080.  
  1081.  
  1082. ClearZeile    dc.b    "                                     "
  1083.     even
  1084.  
  1085. WindowSelect    bsr    GetLine    ; which window was selected ?    
  1086.     tst.l    d0
  1087.     bne    wait
  1088.     move.l    a0,FENSTER
  1089.     bsr    FillIn
  1090.  
  1091.     bra    ShowWindow
  1092.  
  1093.  
  1094. FRONT    move.l    FENSTER(pc),a0    ; move window to front
  1095.     cmp.l    #0,a0
  1096.     beq    Error
  1097.     CALLINT    WindowToFront
  1098.     bra    wait
  1099. BACK    move.l    FENSTER(pc),a0    ;  "    "     " back
  1100.     cmp.l    #0,a0
  1101.     beq    Error
  1102.     CALLINT    WindowToBack
  1103.     bra    wait
  1104. CLEAR    move.l    FENSTER(pc),a0    ; clear pointer
  1105.     cmp.l    #0,a0
  1106.     beq    Error
  1107.     CALLINT    ClearPointer
  1108.     bra    wait
  1109.  
  1110. NewLimits    move.l    FENSTER(pc),a0    ; define new limits
  1111.     cmp.l    #0,a0
  1112.     beq    Error
  1113.     moveq.l    #0,d0
  1114.     moveq.l    #0,d1
  1115.     moveq.l    #0,d2
  1116.     moveq.l    #0,d3
  1117.  
  1118.     move.w    G12_Info+si_LongInt+2(pc),d0    
  1119.     move.w    G13_Info+si_LongInt+2(pc),d1    
  1120.     move.w    G14_Info+si_LongInt+2(pc),d2    
  1121.     move.w    G15_Info+si_LongInt+2(pc),d3
  1122.     
  1123.     CALLINT    WindowLimits
  1124.     bra    wait    
  1125.  
  1126. NewPen    move.l    FENSTER(pc),a0     ; define new pens
  1127.     cmp.l    #0,a0
  1128.     beq    Error
  1129.     move.b    G16_Info+si_LongInt+3(pc),wd_BlockPen(a0)
  1130.     move.b    G21_Info+si_LongInt+3(pc),wd_DetailPen(a0)
  1131.  
  1132.  
  1133. FRAME    move.l    FENSTER(pc),a0
  1134.     cmp.l    #0,a0
  1135.     beq    Error
  1136.     CALLINT    RefreshWindowFrame    ; use them !
  1137.     bra    wait
  1138. REFRESH    move.l    FENSTER(pc),a1        ; refresh gadgets (if there are any to be refreshed !)
  1139.     cmp.l    #0,a1
  1140.     beq    Error
  1141.     move.l    wd_FirstGadget(a1),a0
  1142.     sub.l    a2,a2
  1143.     cmp.l    #0,a0
  1144.     beq    Error
  1145.     CALLINT    RefreshGadgets
  1146.     bra    wait
  1147.  
  1148. FillIn    move.l    FENSTER(pc),a6        ; put data from window into longint gadgets
  1149.     cmp.l    #0,a6
  1150.     beq    .Label1
  1151.     
  1152.     lea.l    G12_Puffer(pc),a0
  1153.     moveq.l    #0,d0
  1154.     move.w    wd_MinWidth(a6),d0
  1155.  
  1156.     move.l    d0,G12_Info+si_LongInt
  1157.  
  1158.     bsr    MakeZahl3
  1159.     
  1160.     lea.l    G13_Puffer(pc),a0
  1161.     moveq.l    #0,d0
  1162.     move.w    wd_MinHeight(a6),d0
  1163.     move.l    d0,G13_Info+si_LongInt
  1164.  
  1165.     bsr    MakeZahl3
  1166.  
  1167.     lea.l    G14_Puffer(pc),a0
  1168.     moveq.l    #0,d0
  1169.     move.w    wd_MaxWidth(a6),d0
  1170.     cmp.w    #999,d0
  1171.     bls    .Label3
  1172.     moveq.l    #0,d0
  1173. .Label3    move.l    d0,G14_Info+si_LongInt
  1174.  
  1175.     bsr    MakeZahl3
  1176.  
  1177.     lea.l    G15_Puffer(pc),a0
  1178.     moveq.l    #0,d0
  1179.     move.w    wd_MaxHeight(a6),d0
  1180.     cmp.w    #999,d0
  1181.     bls    .Label4
  1182.     moveq.l    #0,d0
  1183. .Label4    move.l    d0,G15_Info+si_LongInt
  1184.  
  1185.     bsr    MakeZahl3
  1186.  
  1187.     lea.l    G17_Puffer(pc),a0
  1188.     moveq.l    #0,d0
  1189.     move.w    wd_LeftEdge(a6),d0
  1190.     move.l    d0,G17_Info+si_LongInt
  1191.  
  1192.     bsr    MakeZahl3
  1193.  
  1194.     lea.l    G18_Puffer(pc),a0
  1195.     moveq.l    #0,d0
  1196.     move.w    wd_TopEdge(a6),d0
  1197.     move.l    d0,G18_Info+si_LongInt
  1198.  
  1199.     bsr    MakeZahl3
  1200.  
  1201.  
  1202.     lea.l    G19_Puffer(pc),a0
  1203.     moveq.l    #0,d0
  1204.     move.w    wd_Width(a6),d0
  1205.     move.l    d0,G19_Info+si_LongInt
  1206.  
  1207.     bsr    MakeZahl3
  1208.  
  1209.     lea.l    G20_Puffer(pc),a0
  1210.     moveq.l    #0,d0
  1211.     move.w    wd_Height(a6),d0
  1212.     move.l    d0,G20_Info+si_LongInt
  1213.  
  1214.     bsr    MakeZahl3
  1215.  
  1216.     
  1217.     lea.l    G16_Puffer(pc),a0
  1218.     moveq.l    #0,d0
  1219.     move.b    wd_BlockPen(a6),d0
  1220.     move.l    d0,G16_Info+si_LongInt
  1221.  
  1222.     bsr    MakeZahl2
  1223.  
  1224.     lea.l    G21_Puffer(pc),a0
  1225.     moveq.l    #0,d0
  1226.     move.b    wd_DetailPen(a6),d0
  1227.     move.l    d0,G21_Info+si_LongInt
  1228.  
  1229.     bsr    MakeZahl2
  1230.  
  1231.     lea.l    Gadget12(pc),a0
  1232.     move.l    Window1(pc),a1
  1233.     sub.l    a2,a2
  1234.     CALLINT    RefreshGadgets
  1235.     rts
  1236.  
  1237. .Label1    clr.b    G12_Puffer
  1238.     clr.b    G13_Puffer
  1239.     clr.b    G14_Puffer
  1240.     clr.b    G15_Puffer
  1241.     clr.b    G16_Puffer
  1242.     clr.b    G17_Puffer
  1243.     clr.b    G18_Puffer
  1244.     clr.b    G19_Puffer
  1245.     clr.b    G20_Puffer
  1246.     clr.b    G21_Puffer
  1247.     
  1248.     lea.l    Gadget12(pc),a0
  1249.     move.l    Window1(pc),a1
  1250.     sub.l    a2,a2
  1251.     CALLINT    RefreshGadgets
  1252.     rts
  1253.  
  1254.  
  1255.  
  1256. Windowdef4    dc.w    (640-300)/2,45,300,80
  1257.     dc.b    -1,-1
  1258.     dc.l    GADGETUP
  1259.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  1260.     dc.l    GadgetGURU
  1261.     dc.l    0
  1262.     dc.l    W4_Title
  1263.     dc.l    0,0
  1264.     dc.w    0,0,0,0,CUSTOMSCREEN
  1265. W4_Title    dc.b    "          » ERROR MESSAGE «           ",0
  1266.     even
  1267. GadgetGURU    AUTOGADGET     20,60,260,12,3,1,<"Exit">,0,0
  1268.     even
  1269.  
  1270. GURU    lea.l    Windowdef4(pc),a0
  1271.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  1272.     CALLINT    OpenWindow
  1273.     tst.l    d0
  1274.     beq    Undo
  1275.     move.l    d0,Window2
  1276.  
  1277. WindowPointer set Window2
  1278.  
  1279.     SETAPEN    #2
  1280.     RECTFILL    #2,#10,#297,#78
  1281.  
  1282.     SETDRMD    #RP_JAM1
  1283.     WRITE    #6+((290-32*8)/2),#20+1,#0,<"Sorry - But if I moved / resized">
  1284.     WRITE    #6+((290-29*8)/2),#30+1,#0,<"the window , the system would">
  1285.     WRITE    #6+((290-30*8)/2),#40+1,#0,<"crash !!!  Check screen size !">
  1286.  
  1287.     WRITE    #5+((290-32*8)/2),#20,#1,<"Sorry - But if I moved / resized">
  1288.     WRITE    #5+((290-29*8)/2),#30,#1,<"the window , the system would">
  1289.     WRITE    #5+((290-30*8)/2),#40,#1,<"crash !!!  Check screen size !">
  1290.  
  1291.  
  1292.     
  1293.     lea.l    GadgetGURU(pc),a0
  1294.     move.l    Window2(pc),a1
  1295.     sub.l    a2,a2
  1296.     CALLINT    RefreshGadgets
  1297.  
  1298.     move.l    Window2(pc),a0        
  1299.     move.l    wd_UserPort(a0),a0
  1300.     CALLEXEC    WaitPort
  1301.  
  1302.     move.l    Window2(pc),a0
  1303.     CALLINT    CloseWindow
  1304.  
  1305. Undo    move.l    FENSTER(pc),a6        ; get current data (to undo illegal data) 
  1306.     lea.l    G17_Puffer(pc),a0
  1307.     moveq.l    #0,d0
  1308.     move.w    wd_LeftEdge(a6),d0
  1309.     move.l    d0,G17_Info+si_LongInt
  1310.  
  1311.     bsr    MakeZahl3
  1312.  
  1313.     lea.l    G18_Puffer(pc),a0
  1314.     moveq.l    #0,d0
  1315.     move.w    wd_TopEdge(a6),d0
  1316.     move.l    d0,G18_Info+si_LongInt
  1317.  
  1318.     bsr    MakeZahl3
  1319.  
  1320.  
  1321.     lea.l    G19_Puffer(pc),a0
  1322.     moveq.l    #0,d0
  1323.     move.w    wd_Width(a6),d0
  1324.     move.l    d0,G19_Info+si_LongInt
  1325.  
  1326.     bsr    MakeZahl3
  1327.  
  1328.     lea.l    G20_Puffer(pc),a0
  1329.     moveq.l    #0,d0
  1330.     move.w    wd_Height(a6),d0
  1331.     move.l    d0,G20_Info+si_LongInt
  1332.  
  1333.     bsr    MakeZahl3
  1334.  
  1335.     lea.l    Gadget17(pc),a0
  1336.     move.l    Window1(pc),a1
  1337.     sub.l    a2,a2
  1338.     CALLINT    RefreshGadgets
  1339.  
  1340.     bra    wait
  1341.     
  1342. WindowPointer set Window1
  1343.  
  1344. MoveWindow    move.l    FENSTER(pc),a0        ; move window
  1345.     move.l    G17_Info+si_LongInt(pc),d0
  1346.     move.l    G18_Info+si_LongInt(pc),d1
  1347.  
  1348.     move.l    d0,d2
  1349.     move.l    d1,d3
  1350.  
  1351.     add.w    wd_Width(a0),d2
  1352.     add.w    wd_Height(a0),d3
  1353.  
  1354.     move.l    wd_WScreen(a0),a1
  1355.  
  1356.     cmp.w    sc_Width(a1),d2    ; check if they are possible !!!!
  1357.     bhi    GURU
  1358.     cmp.w    sc_Height(a1),d3
  1359.     bhi    GURU
  1360.     
  1361.     sub.w    wd_LeftEdge(a0),d0
  1362.     sub.w    wd_TopEdge(a0),d1
  1363.  
  1364.     CALLINT    MoveWindow
  1365.     bra    wait
  1366.  
  1367. SizeWindow    move.l    FENSTER(pc),a0        ; re-size window
  1368.     move.l    G19_Info+si_LongInt(pc),d0
  1369.     move.l    G20_Info+si_LongInt(pc),d1
  1370.  
  1371.     move.l    d0,d2
  1372.     move.l    d1,d3
  1373.  
  1374.     add.w    wd_LeftEdge(a0),d2
  1375.     add.w    wd_TopEdge(a0),d3
  1376.  
  1377.     move.l    wd_WScreen(a0),a1
  1378.  
  1379.     cmp.w    sc_Width(a1),d2    ; check if they are possible !!!!
  1380.     bhi    GURU
  1381.     cmp.w    sc_Height(a1),d3
  1382.     bhi    GURU
  1383.     
  1384.     sub.w    wd_Width(a0),d0
  1385.     sub.w    wd_Height(a0),d1
  1386.  
  1387.     CALLINT    SizeWindow
  1388.     bra    wait    
  1389.     
  1390.  
  1391.  
  1392. Windowdef5    dc.w    275+184,30,174,100
  1393.     dc.b    -1,-1
  1394.     dc.l    GADGETUP
  1395.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  1396.     dc.l    GadgetKILL1
  1397.     dc.l    0
  1398.     dc.l    W5_Title
  1399.     dc.l    0,0
  1400.     dc.w    0,0,0,0,CUSTOMSCREEN
  1401. W5_Title    dc.b    " » KILL WINDOW «     ",0
  1402.     even
  1403. GadgetKILL1    AUTOGADGET     10,60,154,12,3,1,<"YES !">,0,GadgetKILL2
  1404.     even
  1405. GadgetKILL2    AUTOGADGET     10,80,154,12,3,1,<"No - forget it !">,1,0
  1406.     even
  1407.  
  1408. KillWindow    tst.l    FENSTER
  1409.     beq    Error
  1410.  
  1411.     lea.l    Windowdef5(pc),a0
  1412.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  1413.     CALLINT    OpenWindow
  1414.     tst.l    d0
  1415.     beq    KILL_IT
  1416.     move.l    d0,Window2
  1417.  
  1418. WindowPointer set Window2
  1419.  
  1420.     SETAPEN    #2
  1421.     RECTFILL    #2,#10,#171,#98
  1422.  
  1423.     SETDRMD    #RP_JAM1
  1424.     WRITE    #1+((174-18*8)/2),#20+1,#0,<"Do you really want">
  1425.     WRITE    #1+((174-18*8)/2),#30+1,#0,<"to    close    the">
  1426.     WRITE    #1+((174-18*8)/2),#40+1,#0,<"     window ?     ">
  1427.  
  1428.     WRITE    #0+((174-18*8)/2),#20,#1,<"Do you really want">
  1429.     WRITE    #0+((174-18*8)/2),#30,#1,<"to    close    the">
  1430.     WRITE    #0+((174-18*8)/2),#40,#1,<"     window ?     ">
  1431.     
  1432.  
  1433.     lea.l    GadgetKILL1(pc),a0
  1434.     move.l    Window2(pc),a1
  1435.     sub.l    a2,a2
  1436.     CALLINT    RefreshGadgets
  1437.  
  1438.     move.l    Window2(pc),a0        
  1439.     move.l    wd_UserPort(a0),a0
  1440.     move.l    a0,a5
  1441.     CALLEXEC    WaitPort        
  1442.     move.l    a5,a0
  1443.     CALLEXEC    GetMsg        ; get message
  1444.     move.l    d0,a1    
  1445.     move.l    im_IAddress(a1),a4
  1446.     CALLEXEC     ReplyMsg        ; reply message        
  1447.  
  1448.     tst.w    gg_GadgetID(a4)
  1449.     beq    KILL_IT
  1450.  
  1451.     move.l    Window2(pc),a0
  1452.     CALLINT    CloseWindow
  1453.     bra    wait
  1454.  
  1455. KILL_IT    move.l    Window2(pc),a0
  1456.     CALLINT    CloseWindow
  1457.     move.l    FENSTER(pc),a0
  1458.     CALLINT    CloseWindow
  1459.     bra    GetWindows
  1460.  
  1461. Windowpointer    set Window1
  1462.  
  1463.  
  1464.     
  1465.  
  1466. AUTOGADGET2    macro
  1467. * \1,\2    x,y
  1468. * \3,\4    size
  1469. * \5,\6    colors (text & Box)
  1470. * \7       Text
  1471. * \8       ID
  1472. * \9       NextGadget
  1473.  
  1474.     dc.l    \9
  1475.     dc.w    \1,\2,\3,\4
  1476.     dc.w    GADGHCOMP!SELECTED,RELVERIFY!TOGGLESELECT,BOOLGADGET
  1477.     dc.l    AG2adget\@_Box
  1478.     dc.l    0,AG2adget\@_Text,0,0
  1479.     dc.w    \8,0,0
  1480. AG2adget\@_Box    BOX    -1,-1,\3,\4,\5,0
  1481.     even
  1482.  
  1483. AG2_T_String\@    dc.b    \7,0
  1484. AG2_T_String\@_End    
  1485.     even
  1486. AG2adget\@_Text    dc.b    2,0,RP_JAM1,0
  1487.     dc.w    (\3-(AG2_T_String\@_End-AG2_T_String\@-1)*8)/2+1,((\4-8)/2)+1
  1488.     dc.l    TOPAZ_80,AG2_T_String\@,AG2_Text2_\@
  1489.  
  1490. AG2_Text2_\@    dc.b    \6,0,RP_JAM1,0
  1491.     dc.w    (\3-(AG2_T_String\@_End-AG2_T_String\@-1)*8)/2),(\4-8)/2
  1492.     dc.l    TOPAZ_80,AG2_T_String\@,0
  1493.  
  1494.     
  1495.     IFEQ    FontFlag
  1496.  
  1497. TOPAZ_80    dc.l    T_80name
  1498.     dc.w    TOPAZ_EIGHTY
  1499.     dc.b    FS_NORMAL,FPF_ROMFONT
  1500.     even
  1501. T_80name    dc.b    "topaz.font",0
  1502.  
  1503. FontFlag    set    1
  1504.     endc
  1505.     endm
  1506.  
  1507.  
  1508.  
  1509.  
  1510. Windowdef6    dc.w    640-300-10,0,300,199
  1511.     dc.b    -1,-1
  1512.     dc.l    GADGETUP
  1513.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  1514.     dc.l    GadgetIDCMP
  1515.     dc.l    0
  1516.     dc.l    W6_Title
  1517.     dc.l    0,0
  1518.     dc.w    0,0,0,0,CUSTOMSCREEN
  1519. W6_Title    dc.b    "          » IDCMP FLAGS «                  ",0
  1520.     even
  1521. GadgetIDCMP    AUTOGADGET2     20,20,120,10,3,1,<"SIZEVERIFY">,0,GadgetIDCMP2
  1522.     even
  1523. GadgetIDCMP2    AUTOGADGET2     20,35,120,10,3,1,<"NEWSIZE">,1,GadgetIDCMP3
  1524.     even
  1525. GadgetIDCMP3    AUTOGADGET2     20,50,120,10,3,1,<"REFRESHWINDOW">,2,GadgetIDCMP4
  1526.     even
  1527. GadgetIDCMP4    AUTOGADGET2     20,65,120,10,3,1,<"MOUSEBUTTONS">,3,GadgetIDCMP5
  1528.     even
  1529. GadgetIDCMP5    AUTOGADGET2     20,80,120,10,3,1,<"MOUSEMOVE">,4,GadgetIDCMP6
  1530.     even
  1531. GadgetIDCMP6    AUTOGADGET2     20,95,120,10,3,1,<"GADGETDOWN">,5,GadgetIDCMP7
  1532.     even
  1533. GadgetIDCMP7    AUTOGADGET2     20,110,120,10,3,1,<"GADGETUP">,6,GadgetIDCMP8
  1534.     even
  1535. GadgetIDCMP8    AUTOGADGET2     20,125,120,10,3,1,<"REQSET">,7,GadgetIDCMP9
  1536.     even
  1537. GadgetIDCMP9    AUTOGADGET2     20,140,120,10,3,1,<"MENUPICK">,8,GadgetIDCMP10
  1538.     even
  1539. GadgetIDCMP10    AUTOGADGET2     20,155,120,10,3,1,<"CLOSEWINDOW">,9,GadgetIDCMP11
  1540.     even
  1541. GadgetIDCMP11    AUTOGADGET2     20,170,120,10,3,1,<"RAWKEY">,10,GadgetIDCMP12
  1542.     even
  1543. GadgetIDCMP12    AUTOGADGET2     20,185,120,10,3,1,<"REQVERIFY">,11,GadgetIDCMP13
  1544.     even
  1545.  
  1546. GadgetIDCMP13    AUTOGADGET2     160,20,120,10,3,1,<"REQCLEAR">,12,GadgetIDCMP14
  1547.     even
  1548. GadgetIDCMP14    AUTOGADGET2     160,35,120,10,3,1,<"MENUVERIFY">,13,GadgetIDCMP15
  1549.     even
  1550. GadgetIDCMP15    AUTOGADGET2     160,50,120,10,3,1,<"NEWPREFS">,14,GadgetIDCMP16
  1551.     even
  1552. GadgetIDCMP16    AUTOGADGET2     160,65,120,10,3,1,<"DISKINSERTED">,15,GadgetIDCMP17
  1553.     even
  1554. GadgetIDCMP17    AUTOGADGET2     160,80,120,10,3,1,<"DISKREMOVED">,16,GadgetIDCMP18
  1555.     even
  1556. GadgetIDCMP18    AUTOGADGET2     160,95,120,10,3,1,<"WBENCHMESSAGE">,17,GadgetIDCMP19
  1557.     even
  1558. GadgetIDCMP19    AUTOGADGET2     160,110,120,10,3,1,<"ACTIVEWINDOW">,18,GadgetIDCMP20
  1559.     even
  1560. GadgetIDCMP20    AUTOGADGET2     160,125,120,10,3,1,<"INACTIVEWINDOW">,19,GadgetIDCMP21
  1561.     even
  1562. GadgetIDCMP21    AUTOGADGET2     160,140,120,10,3,1,<"DELTAMOVE">,20,GadgetIDCMP22
  1563.     even
  1564. GadgetIDCMP22    AUTOGADGET2     160,155,120,10,3,1,<"VANILLAKEY">,21,GadgetIDCMP23
  1565.     even
  1566. GadgetIDCMP23    AUTOGADGET2     160,170,120,10,3,1,<"INTUITICKS">,22,GadgetIDCMP_CA
  1567.     even
  1568.  
  1569. GadgetIDCMP_CA    AUTOGADGET     160,185,60,10,1,3,<"Cancel">,100,GadgetIDCMP_OK
  1570.     even
  1571.  
  1572. GadgetIDCMP_OK    AUTOGADGET     240,185,40,10,1,3,<"OK">,101,0
  1573.     even
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580. IDCMP    tst.l    FENSTER
  1581.     beq    Error
  1582.  
  1583.     move.l    FENSTER(pc),a0
  1584.     move.l    wd_IDCMPFlags(a0),.IDCMPFlags
  1585.     move.l    wd_IDCMPFlags(a0),d1
  1586.     
  1587.  
  1588.     moveq.l    #0,d0        ; if bit is 1, set gadget selected
  1589.     lea.l    .GadgetList(pc),a0
  1590. .Label1    move.l    (a0)+,a1
  1591.     btst    d0,d1
  1592.     bne    .Label2
  1593.     and.w    #$ffff-SELECTED,gg_Flags(a1)
  1594.     bra    .Label3
  1595. .Label2    or.w    #SELECTED,gg_Flags(a1)
  1596. .Label3    addq    #1,d0
  1597.     cmp.b    #23,d0
  1598.     bne    .Label1
  1599.  
  1600.  
  1601.     
  1602.     lea.l    Windowdef6(pc),a0
  1603.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  1604.     CALLINT    OpenWindow
  1605.     tst.l    d0
  1606.     beq    wait
  1607.     move.l    d0,Window2
  1608.  
  1609. WindowPointer set Window2
  1610.  
  1611.     SETAPEN    #2
  1612.     RECTFILL    #2,#10,#297,#197
  1613.  
  1614.     
  1615.     lea.l    GadgetIDCMP(pc),a0
  1616.     move.l    Window2(pc),a1
  1617.     sub.l    a2,a2
  1618.     CALLINT    RefreshGadgets
  1619.  
  1620.  
  1621.     
  1622.  
  1623.  
  1624. .wait    move.l    Window2(pc),a0        
  1625.     move.l    wd_UserPort(a0),a0
  1626.     move.l    a0,a5
  1627.     CALLEXEC    WaitPort        
  1628.     move.l    a5,a0
  1629.     CALLEXEC    GetMsg        ; get message
  1630.     move.l    d0,a1    
  1631.     move.l    im_IAddress(a1),a4
  1632.     CALLEXEC     ReplyMsg        ; reply message        
  1633.  
  1634.     moveq.l    #0,d0        
  1635.     move.w    gg_GadgetID(a4),d0
  1636.  
  1637.     cmp.w    #100,d0
  1638.     beq    .Quit
  1639.     cmp.w    #101,d0
  1640.     beq    .Change
  1641.     
  1642.     move.l    .IDCMPFlags(pc),d1
  1643.     bchg    d0,d1
  1644.     move.l    d1,.IDCMPFlags
  1645.     bra    .wait
  1646. .Change    move.l    FENSTER(pc),a0
  1647.     move.l    .IDCMPFlags(pc),d0
  1648.     CALLINT    ModifyIDCMP
  1649.     
  1650. .Quit    move.l    Window2(pc),a0
  1651.     CALLINT    CloseWindow
  1652.     
  1653.     bra    wait
  1654.  
  1655. .GadgetList    dc.l    GadgetIDCMP
  1656.     dc.l    GadgetIDCMP2
  1657.     dc.l    GadgetIDCMP3
  1658.     dc.l    GadgetIDCMP4
  1659.     dc.l    GadgetIDCMP5
  1660.     dc.l    GadgetIDCMP6
  1661.     dc.l    GadgetIDCMP7
  1662.     dc.l    GadgetIDCMP8
  1663.     dc.l    GadgetIDCMP9
  1664.     dc.l    GadgetIDCMP10
  1665.     dc.l    GadgetIDCMP11
  1666.     dc.l    GadgetIDCMP12
  1667.     dc.l    GadgetIDCMP13
  1668.     dc.l    GadgetIDCMP14
  1669.     dc.l    GadgetIDCMP15
  1670.     dc.l    GadgetIDCMP16
  1671.     dc.l    GadgetIDCMP17
  1672.     dc.l    GadgetIDCMP18
  1673.     dc.l    GadgetIDCMP19
  1674.     dc.l    GadgetIDCMP20
  1675.     dc.l    GadgetIDCMP21
  1676.     dc.l    GadgetIDCMP22
  1677.     dc.l    GadgetIDCMP23
  1678.     
  1679. .IDCMPFlags    dc.l    0
  1680.  
  1681. Windowdef9    dc.w    5,30,174,100
  1682.     dc.b    -1,-1
  1683.     dc.l    GADGETUP
  1684.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  1685.     dc.l    GadgetKILL1
  1686.     dc.l    0
  1687.     dc.l    W9_Title
  1688.     dc.l    0,0
  1689.     dc.w    0,0,0,0,CUSTOMSCREEN
  1690. W9_Title    dc.b    "  » KILL SCREEN «    ",0    
  1691.  
  1692.  
  1693. ALL    lea.l    Windowdef9(pc),a0
  1694.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  1695.     CALLINT    OpenWindow
  1696.     tst.l    d0
  1697.     beq    KILL_ALL
  1698.     move.l    d0,Window2
  1699.  
  1700. WindowPointer set Window2
  1701.  
  1702.     SETAPEN    #2
  1703.     RECTFILL    #2,#10,#171,#98
  1704.  
  1705.     SETDRMD    #RP_JAM1
  1706.     WRITE    #1+((174-18*8)/2),#20+1,#0,<"Do you really want">
  1707.     WRITE    #1+((174-18*8)/2),#30+1,#0,<"to    close    the">
  1708.     WRITE    #1+((174-18*8)/2),#40+1,#0,<"     screen ?     ">
  1709.  
  1710.     WRITE    #0+((174-18*8)/2),#20,#1,<"Do you really want">
  1711.     WRITE    #0+((174-18*8)/2),#30,#1,<"to    close    the">
  1712.     WRITE    #0+((174-18*8)/2),#40,#1,<"     screen ?     ">
  1713.     
  1714.  
  1715.     lea.l    GadgetKILL1(pc),a0
  1716.     move.l    Window2(pc),a1
  1717.     sub.l    a2,a2
  1718.     CALLINT    RefreshGadgets
  1719.  
  1720.     move.l    Window2(pc),a0        
  1721.     move.l    wd_UserPort(a0),a0
  1722.     move.l    a0,a5
  1723.     CALLEXEC    WaitPort        
  1724.     move.l    a5,a0
  1725.     CALLEXEC    GetMsg        ; get message
  1726.     move.l    d0,a1    
  1727.     move.l    im_IAddress(a1),a4
  1728.     CALLEXEC     ReplyMsg        ; reply message        
  1729.  
  1730.     tst.w    gg_GadgetID(a4)
  1731.     beq    KILL_ALL
  1732.  
  1733.     move.l    Window2(pc),a0
  1734.     CALLINT    CloseWindow
  1735.     bra    wait
  1736.  
  1737. KILL_ALL    
  1738.     move.l    BILDSCHIRM(pc),a5
  1739.  
  1740. .Label1    move.l    sc_FirstWindow(a5),a0    ; close window (if there are any windows left )
  1741.     cmp.l    #0,a0
  1742.     beq    .Label2
  1743.     CALLINT    CloseWindow
  1744.     bra    .Label1
  1745. .Label2    move.l    BILDSCHIRM(pc),a0
  1746.     CALLINT    CloseScreen
  1747.     move.l    Window2(pc),a0
  1748.     CALLINT    CloseWindow
  1749.     bra    ChangeScreen
  1750.  
  1751.  
  1752. Windowdef7    dc.w    5,50,174,100
  1753.     dc.b    -1,-1
  1754.     dc.l    GADGETUP
  1755.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  1756.     dc.l    Gadget_7_1
  1757.     dc.l    0
  1758.     dc.l    W7_Title
  1759.     dc.l    0,0
  1760.     dc.w    0,0,0,0,CUSTOMSCREEN
  1761. W7_Title    dc.b    "  Save Screen As     ",0
  1762.     even
  1763. Gadget_7_1    AUTOGADGET     10,20,154,12,3,1,<"IFF-ILBM">,0,Gadget_7_2
  1764.     even
  1765. Gadget_7_2    AUTOGADGET     10,40,154,12,3,1,<"Dump">,1,Gadget_7_3
  1766.     even
  1767. Gadget_7_3    AUTOGADGET     10,60,154,12,3,1,<"Colour & Dump">,2,Gadget_7_4
  1768.     even
  1769. Gadget_7_4    AUTOGADGET     10,80,154,12,3,1,<"No - forget it !">,3,0
  1770.     even
  1771.  
  1772. SaveMode    dc.b    0
  1773.     even
  1774.  
  1775. SaveScreen    clr.b    SaveMode
  1776.     lea.l    Windowdef7(pc),a0
  1777.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  1778.     CALLINT    OpenWindow
  1779.     tst.l    d0
  1780.     beq    SS_IFF
  1781.     move.l    d0,Window2
  1782.  
  1783. WindowPointer set Window2
  1784.  
  1785.     SETAPEN    #2
  1786.     RECTFILL    #2,#10,#171,#98
  1787.  
  1788.  
  1789.     lea.l    Gadget_7_1(pc),a0
  1790.     move.l    Window2(pc),a1
  1791.     sub.l    a2,a2
  1792.     CALLINT    RefreshGadgets
  1793.  
  1794.     move.l    Window2(pc),a0        
  1795.     move.l    wd_UserPort(a0),a0
  1796.     move.l    a0,a5
  1797.     CALLEXEC    WaitPort        
  1798.     move.l    a5,a0
  1799.     CALLEXEC    GetMsg        ; get message
  1800.     move.l    d0,a1    
  1801.     move.l    im_IAddress(a1),a4
  1802.     CALLEXEC     ReplyMsg        ; reply message        
  1803.     move.l    Window2(pc),a0
  1804.     CALLINT    CloseWindow
  1805.     move.b    gg_GadgetID+1(a4),SaveMode
  1806.     cmp.b    #3,SaveMode
  1807.     beq    wait
  1808. SS_IFF    moveq.l    #0,d0
  1809.     move.b    SaveMode(pc),d0
  1810.     mulu    #40,d0
  1811.     add.l    #SaveText1,d0
  1812.     lea.l    FileReq(pc),a0    
  1813.     move.l    d0,(a0)
  1814.     move.l    _ARPBase(pc),a6
  1815.     move.l    Window1(pc),12(a0)
  1816.     jsr    -294(a6)        ; file requester
  1817.     tst.l    d0
  1818.     beq    wait    
  1819.     move.l    d0,d6
  1820.     move.l    #Dir,d1
  1821.     moveq.l    #ACCESS_READ,d2
  1822.     CALLDOS    Lock
  1823.     tst.l    d0
  1824.     beq    .O1
  1825.     move.l    d0,d1
  1826.     CALLDOS    CurrentDir        ; set current dir
  1827. .O1    move.l    d6,d0
  1828.     tst.b    SaveMode
  1829.     beq    SaveIFF
  1830.     move.l    d0,d1
  1831.     move.l    #MODE_NEWFILE,d2
  1832.     CALLDOS    Open
  1833.     tst.l    d0
  1834.     beq    .Error
  1835.     move.l    d0,d7
  1836.     cmp.b    #1,SaveMode
  1837.     beq    .SaveDump
  1838.     move.l    BILDSCHIRM(pc),a0    ;save screen as COLOUR & DUMP
  1839.     lea.l    sc_ViewPort(a0),a0
  1840.     move.l    vp_ColorMap(a0),a0    
  1841.     moveq.l    #0,d3
  1842.     move.w    cm_Count(a0),d3            
  1843.     add.w    d3,d3
  1844.     move.l    cm_ColorTable(a0),d2
  1845.     move.l    d7,d1
  1846.     CALLDOS    Write
  1847.     cmp.l    d3,d0
  1848.     bne    .DiskError
  1849. .SaveDump    move.l    BILDSCHIRM(pc),a0
  1850.     lea.l    sc_BitMap(a0),a0
  1851.     moveq.l    #0,d4
  1852.     move.b    bm_Depth(a0),d4
  1853.     subq.l    #1,d4
  1854.     moveq.l    #0,d5
  1855.     move.w    bm_BytesPerRow(a0),d5
  1856.     mulu    bm_Rows(a0),d5
  1857.  
  1858.     lea.l    bm_Planes(a0),a4
  1859. .L1    move.l    (a4)+,d2
  1860.     move.l    d5,d3
  1861.     move.l    d7,d1
  1862.     CALLDOS    Write
  1863.     cmp.l    d5,d0    
  1864.     bne    .DiskError
  1865.     dbra    d4,.L1
  1866.     bra.s    .L2
  1867. .DiskError    move.l    ScreenPtr1(pc),a0    
  1868.     CALLINT    DisplayBeep
  1869. .L2    move.l    d7,d1
  1870.     CALLDOS    Close
  1871.     bra    wait
  1872. .Error    move.l    ScreenPtr1(pc),a0    
  1873.     CALLINT    DisplayBeep
  1874.     bra    wait
  1875.  
  1876. FileReq    dc.l    0
  1877.     dc.l    File
  1878.     dc.l    Dir
  1879.     dc.l    0
  1880.     dc.b    0,0
  1881.     dc.l    0,0
  1882.  
  1883. SaveText1    dc.b    "Save Screen As IFF                     ",0
  1884.     even
  1885. SaveText2    dc.b    "Save Screen As DUMP                    ",0
  1886.     even
  1887. SaveText3    dc.b    "Save Screen As COLOUR & DUMP           ",0
  1888.     even
  1889. File    ds.b    34
  1890.     even
  1891. Dir    ds.b    34
  1892.     even
  1893.  
  1894. SPic_File        dc.l    0
  1895. SPic_BMHD        dc.l    Header    
  1896. SPic_BitMap        dc.l    0        
  1897. SPic_Mask        dc.l    0
  1898. SPic_Colortable    dc.l    0
  1899. SPic_Chunks        dc.l    0    
  1900. SPic_ChunkSize        dc.l    0
  1901. SPic_ViewMode        dc.l    V_HIRES    
  1902. SPic_SelectPlanes    dc.l    -1    
  1903. SPic_Flags        dc.l    1
  1904. SPic_Buffer        ds.b    200
  1905. SPic_PackerBuffer    ds.b    200
  1906. SPic_BMwidth        dc.l    0    
  1907. SPic_BytesPerRow    dc.l    0
  1908. SPic_StartRow        dc.l    0
  1909. SPic_EndRow        dc.l    0
  1910. SPic_SkipBytes        dc.l    0
  1911. SPic_Shift        dc.l    0
  1912. SPic_BodyPos        dc.l    0
  1913. SPic_FileHandle    dc.l    0    
  1914. SPic_A6        dc.l    0
  1915. SPic_PlaneBuffer    ds.l    10
  1916.  
  1917.  
  1918. Header    dc.w    80,3
  1919.     dc.w    0,0
  1920.     dc.b    1,0,1,0
  1921.     dc.w    0
  1922.     dc.b    1,1
  1923.     dc.w    640,256
  1924.  
  1925.  
  1926. SaveIFF    move.l    d0,SPic_File        ; save as IFF pic
  1927.     move.l    BILDSCHIRM(pc),a0
  1928.     move.l    sc_Width(a0),Header
  1929.     move.l    sc_Width(a0),Header+16
  1930.     clr.l    Header+4
  1931. SaveWind    lea.l    sc_BitMap(a0),a0
  1932.     move.l    a0,SPic_BitMap
  1933.     move.b    bm_Depth(a0),Header+8
  1934.     move.l    BILDSCHIRM(pc),a0
  1935.     lea.l    sc_ViewPort(a0),a0
  1936.     moveq.l    #0,d0
  1937.     move.w    vp_Modes(a0),d0
  1938.     and.w    #%1000100010000100,d0
  1939.     move.l    d0,SPic_ViewMode
  1940.     move.l    vp_ColorMap(a0),a0    
  1941.     moveq.l    #0,d3
  1942.     move.w    cm_Count(a0),d3            
  1943.     add.w    d3,d3
  1944.     move.l    cm_ColorTable(a0),SPic_Colortable
  1945.     bsr.s    .Save
  1946.     bra    wait    
  1947.  
  1948.     
  1949. .Save    move.l    a6,SPic_A6
  1950.  
  1951.     move.l    SPic_BitMap(pc),a0    ; verify sizes
  1952.     move.l    SPic_BMHD(pc),a1
  1953.     moveq.l    #0,d0
  1954.     move.w    bm_BytesPerRow(a0),d0    
  1955.     move.l    d0,SPic_BMwidth        ;
  1956.     lsl.w    #3,d0            ; width of bitmap
  1957.     move.w    (a1),d1
  1958.     add.w    4(a1),d1            ; IFF_width + IFF_offsetX 
  1959.     cmp.w    d0,d1
  1960.     bhi    .SizeError
  1961.     move.w    bm_Rows(a0),d0            ; height of bitmap    
  1962.     move.w    2(a1),d1            ; IFF_heigth + IFF_offsetY
  1963.     add.w    6(a1),d1
  1964.     cmp.w    d0,d1
  1965.     bhi    .SizeError
  1966.  
  1967.     moveq.l    #0,d0            ; calculate ...
  1968.     move.w    (a1),d0             ; bytes of IFF_width ( word alligned)
  1969.     add.w    #15,d0
  1970.     lsr.l    #3,d0        
  1971.     bclr    #0,d0
  1972.     move.l    d0,SPic_BytesPerRow
  1973.     moveq.l    #0,d0
  1974.     move.w    6(a1),d0
  1975.     move.l    d0,SPic_StartRow        ; start at row
  1976.     moveq.l    #0,d0
  1977.     move.w    4(a1),d0
  1978.     and.l    #15,d0
  1979.     move.l    d0,SPic_Shift            ; how often should I move bits to the left
  1980.     moveq.l    #0,d0
  1981.     move.w    4(a1),d0
  1982.     lsr.w    #3,d0
  1983.     bclr    #0,d0
  1984.     move.l    d0,SPic_SkipBytes        ; how many bytes should I skip per row
  1985.  
  1986.  
  1987.     moveq.l    #0,d0
  1988.     move.w    2(a1),d0
  1989.     add.w    6(a1),d0
  1990.     move.l    d0,SPic_EndRow            ; stop at row
  1991.  
  1992.  
  1993.     moveq.l    #0,d0
  1994.     move.b    8(a1),d0    
  1995.     subq.l    #1,d0
  1996.     lea.l    bm_Planes(a0),a2
  1997.     lea.l    SPic_PlaneBuffer(pc),a3
  1998. .K1    move.l    (a2)+,(a3)+
  1999.     dbra    d0,.K1
  2000.     clr.l    (a3)+
  2001.  
  2002.     move.l    SPic_File(pc),d1
  2003.     move.l    #MODE_NEWFILE,d2
  2004.     CALLDOS    Open
  2005.     tst.l    d0
  2006.     beq    .L1
  2007.     move.l    d0,SPic_FileHandle
  2008.     CALLEXEC    Forbid
  2009.     move.l    SPic_FileHandle(pc),d1
  2010.     move.l    #.FORM,d2        ; write IFF File Header
  2011.     move.l    #20,d3
  2012.     CALLDOS    Write
  2013.     cmp.l    #20,d0
  2014.     bne    .WriteError
  2015.     
  2016.  
  2017.     move.l    SPic_BMHD(pc),a0    ; write BMHD
  2018.     move.l    a0,d2
  2019.     move.l    #20,d3
  2020.     move.l    SPic_FileHandle(pc),d1
  2021.     CALLDOS    Write
  2022.     cmp.l    #20,d0
  2023.     bne    .WriteError
  2024.  
  2025.     lea.l    SPic_Buffer(pc),a0    ; write CMAP
  2026.     move.l    a0,d6
  2027.     move.l    SPic_BMHD(pc),a1    
  2028.     moveq.l    #0,d0        ; number of colours (2^depth)
  2029.     move.b    8(a1),d0
  2030.     moveq.l    #0,d1
  2031.     bset    d0,d1
  2032.     move.l    #"CMAP",(a0)+
  2033.     move.l    d1,d0
  2034.     mulu    #3,d0
  2035.     move.l    d0,d5
  2036.     move.l    d0,(a0)+
  2037.     subq.l    #1,d1
  2038.     move.l    SPic_Colortable(pc),a1    
  2039. .L2    move.w    (a1)+,d2        ; copy colours into buffer
  2040.     move.w    d2,d3
  2041.     move.w    d2,d4
  2042.     lsr.w    #4,d2
  2043.     lsl.w    #4,d3
  2044.     and.w    #$f0,d2
  2045.     and.w    #$f0,d3
  2046.     and.w    #$f0,d4
  2047.     move.b    d2,(a0)+
  2048.     move.b    d4,(a0)+
  2049.     move.b    d3,(a0)+
  2050.     dbra    d0,.L2
  2051.     move.l    d6,d2
  2052.     move.l    d5,d3
  2053.     add.l    #8,d3
  2054.     move.l    SPic_FileHandle(pc),d1
  2055.     CALLDOS    Write
  2056.     cmp.l    d3,d0
  2057.     bne    .WriteError
  2058.  
  2059.     lea.l    SPic_Buffer(pc),a0        ; write CAMG
  2060.     move.l    a0,d2
  2061.     move.l    #"CAMG",(a0)+
  2062.     move.l    #4,(a0)+
  2063.     move.l    SPic_ViewMode(pc),(a0)
  2064.     move.l    #12,d3
  2065.     move.l    SPic_FileHandle(pc),d1
  2066.     CALLDOS    Write
  2067.     cmp.l    #12,d0
  2068.     bne    .WriteError
  2069.  
  2070.     move.l    SPic_Chunks(pc),d2        ; write additional chunks
  2071.     move.l    SPic_ChunkSize(pc),d3
  2072.     tst.l    d2
  2073.     beq.s    .L3
  2074.     tst.l    d3
  2075.     beq.s    .L3
  2076.     move.l    SPic_FileHandle(pc),d1
  2077.     CALLDOS    Write
  2078.     move.l    SPic_ChunkSize(pc),d1
  2079.     cmp.l    d1,d0
  2080.     bne    .WriteError
  2081.  
  2082.  
  2083. .L3    move.l    #.BODY,d2            ; write BODY
  2084.     moveq.l    #8,d3        
  2085.     move.l    SPic_FileHandle(pc),d1
  2086.     CALLDOS    Write
  2087.     cmp.l    #8,d0
  2088.     bne    .WriteError
  2089.  
  2090.     move.l    SPic_FileHandle(pc),d1    ; we'll write the chunk size later...    
  2091.     moveq.l    #OFFSET_CURRENT,d3
  2092.     moveq.l    #0,d2
  2093.     CALLDOS    Seek
  2094.     move.l    d0,SPic_BodyPos
  2095.  
  2096.     move.l    SPic_StartRow(pc),d7    ; current row = d7
  2097.     subq.l    #1,d7    
  2098. .U4    addq.l    #1,d7
  2099. .U1    cmp.l    SPic_EndRow(pc),d7        ; last row ????
  2100.     beq    .Q1
  2101.     lea.l    SPic_PlaneBuffer(pc),a4    ; get pointer to bitplane
  2102. .U2    move.l    (a4)+,a0        
  2103.     cmp.l    #0,a0        ; last bitplane ????
  2104.     beq    .U4
  2105.     move.l    SPic_BMwidth(pc),d0    ; offset
  2106.     mulu    d7,d0
  2107.     add.l    d0,a0
  2108.     lea.l    SPic_Buffer(pc),a1        ; copy row to buffer
  2109.     move.l    a0,d2
  2110.     move.l    SPic_BMwidth(pc),d0
  2111.     subq.l    #1,d0
  2112. .U3    move.b    (a0)+,(a1)+
  2113.     dbra    d0,.U3
  2114.     add.l    SPic_SkipBytes(pc),d2    ; skip some bytes
  2115.  
  2116.     move.l    SPic_Shift(pc),d4        ; shift bits to the left
  2117.     tst.l    d0
  2118.     beq    .U5
  2119.     move.l    d2,a0
  2120.     move.l    SPic_BytesPerRow(pc),d0
  2121.     addq.l    #1,d0        ; if you save byte alligned
  2122.     lsr.w    #1,d0
  2123.     subq.l    #1,d0
  2124. .U6    move.w    (a0),d1        ; copy two words to d1
  2125.     swap    d1
  2126.     move.w    2(a0),d1
  2127.     lsl.l    d4,d1        ; now move bits of 2nd word into the 1st word
  2128.     swap    d1
  2129.     move.w    d1,(a0)+        ; copy 1st word back to buffer 
  2130.     dbra    d0,.U6
  2131.  
  2132. .U5    move.l    SPic_BytesPerRow(pc),d3
  2133.     move.l    SPic_BMHD,a0
  2134.     cmp.b    #1,10(a0)
  2135.     bne    .U7
  2136.     movem.l    d4-d7/a0-a6,-(sp)
  2137.     bsr    Packer
  2138.     movem.l    (sp)+,d4-d7/a0-a6
  2139.  
  2140. .U7    move.l    SPic_FileHandle(pc),d1    ; write row to file
  2141.     CALLDOS    Write
  2142.     cmp.l    d3,d0
  2143.     bne    .WriteError
  2144.     bra    .U2        ; next bitplane
  2145.  
  2146. .Q1    move.l    SPic_FileHandle(pc),d1    ; get file size
  2147.     moveq.l    #OFFSET_CURRENT,d3
  2148.     moveq.l    #0,d2
  2149.     CALLDOS    Seek
  2150.     move.l    d0,d7
  2151.     sub.l    SPic_BodyPos(pc),d0
  2152.     move.l    d0,.BODY+4
  2153.  
  2154.     move.l    SPic_FileHandle(pc),d1    ; write BODY size
  2155.     moveq.l    #OFFSET_BEGINNING,d3
  2156.     move.l    SPic_BodyPos(pc),d2
  2157.     subq.l    #4,d2
  2158.     CALLDOS    Seek
  2159.     
  2160.     move.l    #.BODY+4,d2
  2161.     moveq.l    #4,d3        
  2162.     move.l    SPic_FileHandle(pc),d1
  2163.     CALLDOS    Write
  2164.     cmp.l    #4,d0
  2165.     bne    .WriteError
  2166.  
  2167.     subq.l    #8,d7
  2168.     move.l    d7,.FORM+4
  2169.     move.l    SPic_FileHandle(pc),d1    ; write FORM size
  2170.     moveq.l    #OFFSET_BEGINNING,d3
  2171.     moveq.l    #4,d2
  2172.     CALLDOS    Seek
  2173.     
  2174.     move.l    #.FORM+4,d2
  2175.     moveq.l    #4,d3        
  2176.     move.l    SPic_FileHandle(pc),d1
  2177.     CALLDOS    Write
  2178.     cmp.l    #4,d0
  2179.     bne    .WriteError
  2180.  
  2181.     move.l    SPic_FileHandle(pc),d1
  2182.     CALLDOS    Close
  2183.     CALLEXEC    Permit
  2184.     moveq.l    #0,d0
  2185.     rts
  2186. .L1    
  2187. .SizeError    move.l    ScreenPtr1(pc),a0    
  2188.     CALLINT    DisplayBeep
  2189.     moveq.l    #-1,d0
  2190.     rts
  2191. .WriteError    move.l    SPic_FileHandle(pc),d1
  2192.     CALLDOS    Close    
  2193.     CALLEXEC    Permit
  2194.     move.l    SPic_File(pc),d1
  2195.     CALLDOS    DeleteFile
  2196.     move.l    ScreenPtr1(pc),a0    
  2197.     CALLINT    DisplayBeep
  2198.     moveq.l    #-1,d0
  2199.     rts
  2200.         
  2201.  
  2202.  
  2203.  
  2204. .FORM    dc.b    "FORM"
  2205.     dc.l    0
  2206.     dc.b    "ILBM"
  2207.     dc.b    "BMHD"
  2208.     dc.l    20
  2209. .BODY    dc.b    "BODY"
  2210.     dc.l    0
  2211.     
  2212.  
  2213.     
  2214.     
  2215.  
  2216. Packer    lea.l    SPic_PackerBuffer(pc),a0    ; a0 ^buffer
  2217.     move.l    d2,a1        ; a1 ^row
  2218.     move.l    a1,a2        
  2219.     add.l    d3,a2        ; a2 ^ end of row        
  2220.     move.l    a1,a4
  2221.     
  2222. .P0    cmp.l    a2,a1
  2223.     beq    .Pexit
  2224.     bhi    .Pexit
  2225.     moveq.l    #-1,d5        ; d5 = counter
  2226. .P1    moveq.l    #0,d0        ; wait until two identical bytes  appear
  2227.     addq.l    #1,d5
  2228.     move.b    (a1,d5),d0        ; compare
  2229.     move.l    a1,d1
  2230.     add.l    d5,d1
  2231. *    addq.l    #1,d1
  2232.     cmp.l    a2,d1        ; end of row ????
  2233.     beq    .P5
  2234.     cmp.b    1(a1,d5),d0
  2235.     bne    .P1
  2236. .P5    tst.l    d5        ; are there bytes between two parts of identical bytes
  2237.     beq    .P2
  2238. .P3    subq.l    #1,d5        ; code = n-1
  2239.     move.b    d5,(a0)+
  2240. .P4    move.b    (a1)+,(a0)+        ; copy bytes
  2241.     dbra    d5,.P4
  2242.     bra.s    .P0
  2243.  
  2244. .P2    moveq.l    #-1,d4        ; pack it !
  2245. .P6    addq.l    #1,d4
  2246.     cmp.l    a2,a1
  2247.     beq    .P7    
  2248.     cmp.b    (a1)+,d0
  2249.     beq    .P6
  2250.     tst.b    -(a1)
  2251. .P7    move.l    #257,d1        ; code = 257-n
  2252.     sub.l    d4,d1
  2253.     move.b    d1,(a0)+
  2254.     move.b    d0,(a0)+
  2255.     bra    .P0
  2256. .Pexit    move.l    #SPic_PackerBuffer,d2
  2257.     move.l    a0,d3
  2258.     sub.l    d2,d3
  2259.     btst    #0,d3
  2260.     beq    .P10
  2261.     move.b    #128,(a0)+
  2262.     addq.l    #1,d3
  2263. .P10    rts
  2264.  
  2265.     
  2266.  
  2267. SWindow    dc.b    "Save Window As IFF                      ",0
  2268.  
  2269. SaveWindow    tst.l    FENSTER
  2270.     beq    Error
  2271.     lea.l    FileReq(pc),a0    
  2272.     move.l    #SWindow,(a0)
  2273.     move.l    _ARPBase(pc),a6
  2274.     move.l    Window1(pc),12(a0)
  2275.     jsr    -294(a6)        ; file requester
  2276.     tst.l    d0
  2277.     beq    wait    
  2278.     move.l    d0,d6
  2279.     move.l    #Dir,d1
  2280.     moveq.l    #ACCESS_READ,d2
  2281.     CALLDOS    Lock
  2282.     tst.l    d0
  2283.     beq    .O1
  2284.     move.l    d0,d1
  2285.     CALLDOS    CurrentDir        ; set current dir
  2286. .O1    move.l    d6,d0
  2287.     move.l    d0,SPic_File        ; save as IFF pic
  2288.     move.l    FENSTER(pc),a0
  2289.     CALLINT    WindowToFront
  2290.     move.l    FENSTER(pc),a0
  2291.     CALLINT    ActivateWindow
  2292.     move.l    BILDSCHIRM(pc),a0
  2293.     move.l    FENSTER(pc),a1
  2294.     move.l    wd_Width(a1),Header
  2295.     move.l    wd_LeftEdge(a1),Header+4
  2296.     move.l    sc_Width(a0),Header+16
  2297.     bra    SaveWind
  2298.  
  2299.  
  2300.  
  2301. ScreenBACK    move.l    BILDSCHIRM(pc),a0    ; move screen to back
  2302.     CALLINT    ScreenToBack
  2303.     bra    wait
  2304. ScreenFRONT    move.l    BILDSCHIRM(pc),a0    ; move screen to front
  2305.     CALLINT    ScreenToFront
  2306.     bra    QUIT        ; and exit fenster screen
  2307.  
  2308.  
  2309. QUIT2    move.l    ScreenPtr1(pc),a0
  2310.     CALLINT    CloseScreen
  2311.  
  2312. ende    move.l    #RECOVERY_ALERT,d0    ; error message
  2313.     move.w    #30,d1
  2314.     lea.l    ErrorText(pc),a0
  2315.     CALLINT    DisplayAlert
  2316.     moveq.l    #0,d0
  2317.     rts
  2318. ErrorText    dc.w    60
  2319.     dc.b    17
  2320.     dc.b    "FENSTER  :   ERROR !?!    I cannot open the screen / window !"
  2321.     dc.b     0,0
  2322.  
  2323. SUB    CALLEXEC    Forbid        ; sub Bitplane
  2324.     move.l    BILDSCHIRM(pc),a0
  2325.     lea.l    sc_ViewPort(a0),a1        
  2326.     move.w    vp_Modes(a1),d0
  2327.     and.l    #$800,d0        ; HAM ?
  2328.     bne    SUB1
  2329.     lea.l    sc_BitMap(a0),a0
  2330.     moveq.l    #0,d2
  2331.     move.b    bm_Depth(a0),d2            
  2332.     cmp.b    #1,d2        ; depth =1 ?
  2333.     bls    SUB1
  2334.     sub.b    #1,bm_Depth(a0)
  2335.     subq    #1,d2
  2336.     lsl.l    #2,d2
  2337.     add.l    #bm_Planes,d2
  2338.     moveq.l    #0,d0
  2339.     moveq.l    #0,d1
  2340.     move.w    bm_BytesPerRow(a0),d0
  2341.     lsl.l    #3,d0
  2342.     move.w    bm_Rows(a0),d1
  2343.     move.l    (a0,d2),a0
  2344.     CALLGRAF    FreeRaster        ; free memory
  2345.     move.l    BILDSCHIRM(pc),a0
  2346.     lea.l    sc_ViewPort(a0),a1
  2347.     lea.l    sc_BitMap(a0),a0
  2348.     cmp.b    #5,bm_Depth(a0)
  2349.     bne    SUB2
  2350.     and.w    #$ffff-$80,vp_Modes(a1)    ; clear EHB flag !
  2351. SUB2    CALLINT    RemakeDisplay
  2352.     CALLEXEC    Permit
  2353.     bra    NewDepth
  2354. SUB1    CALLEXEC    Permit        ; cannot sub bitplane
  2355.     sub.l    a0,a0
  2356.     CALLINT    DisplayBeep
  2357.     bra    wait
  2358.  
  2359. ADD    CALLEXEC    Forbid        ; add bitplane
  2360.     move.l    BILDSCHIRM(pc),a0
  2361.     lea.l    sc_BitMap(a0),a0
  2362.     moveq.l    #0,d2
  2363.     move.b    bm_Depth(a0),d2            
  2364.     cmp.b    #5,d2        ; depth = 6 ?
  2365.     bhi    ADD1
  2366.     move.l    BILDSCHIRM(pc),a1
  2367.     lea.l    sc_ViewPort(a1),a1
  2368.     move.w    vp_Modes(a1),d0
  2369.     and.l    #$8000,d0        ; HIRES (x=640) ?
  2370.     beq.s    ADD2
  2371.     move.b    bm_Depth(a0),d2            
  2372.     cmp.b    #3,d2
  2373.     bhi    ADD1
  2374. ADD2    moveq.l    #0,d0
  2375.     moveq.l    #0,d1
  2376.     move.w    bm_BytesPerRow(a0),d0
  2377.     lsl.l    #3,d0
  2378.     move.w    bm_Rows(a0),d1
  2379.     CALLGRAF    AllocRaster        ; get memory ?
  2380.     tst.l    d0
  2381.     beq    ADD1
  2382.     move.l    BILDSCHIRM(pc),a0
  2383.     lea.l    sc_BitMap(a0),a0
  2384.     moveq.l    #0,d2
  2385.     move.b    bm_Depth(a0),d2
  2386.     add.b    #1,bm_Depth(a0)
  2387.     lsl.l    #2,d2
  2388.     add.l    #bm_Planes,d2
  2389.     move.l    d0,(a0,d2)
  2390.     move.l    d0,a1
  2391.     move.l    (a0),d0
  2392.     swap    d0
  2393.     moveq.l    #3,d1
  2394.     CALLGRAF    BltClear        ; clear bitplane
  2395.  
  2396.     move.l    BILDSCHIRM(pc),a0
  2397.     lea.l    sc_BitMap(a0),a0
  2398.     cmp.b    #6,bm_Depth(a0)
  2399.     bne.s    ADD3
  2400.     move.l    BILDSCHIRM(pc),a1
  2401.     lea.l    sc_ViewPort(a1),a1
  2402.     or.w    #$80,vp_Modes(a1)    ; depth =6 => set EHB flag !
  2403. ADD3    CALLINT    RemakeDisplay
  2404.     CALLEXEC    Permit
  2405.     bra    NewDepth
  2406. ADD1    CALLEXEC    Permit        ; cannot add bitplane
  2407.     sub.l    a0,a0
  2408.     CALLINT    DisplayBeep
  2409.     bra    wait
  2410.  
  2411. WindowPointer set Window1
  2412.  
  2413. NewDepth    SETAPEN    #0            ; show new
  2414.     RECTFILL    #10+184+(31*8),#19-6,#10+1+184+(32*8),#19+1
  2415.     move.l    BILDSCHIRM(pc),a5            ; depth
  2416.     lea.l    sc_BitMap(a5),a0
  2417.     move.b    bm_Depth(a0),d0
  2418.     add.b    #"0",d0
  2419.     move.b    d0,Zeile+63-32    
  2420.     SETAPEN    #2
  2421.     move.l    Window1(pc),a1
  2422.     move.l    wd_RPort(a1),a1
  2423.     move.w    #10+1+184+(31*8),d0
  2424.     move.w    #19+1,d1
  2425.     CALLGRAF    Move
  2426.     lea.l    Zeile+31(pc),a0
  2427.     move.l    Window1(pc),a1
  2428.     move.l    wd_RPort(a1),a1
  2429.     moveq.l    #1,d0
  2430.     CALLGRAF    Text
  2431.     SETAPEN    #1
  2432.     move.l    Window1(pc),a1
  2433.     move.l    wd_RPort(a1),a1
  2434.     move.w    #10+184+(31*8),d0
  2435.     move.w    #19,d1
  2436.     CALLGRAF    Move
  2437.     lea.l    Zeile+31(pc),a0
  2438.     move.l    Window1(pc),a1
  2439.     move.l    wd_RPort(a1),a1
  2440.     moveq.l    #1,d0
  2441.     CALLGRAF    Text
  2442.     bra    wait
  2443.  
  2444. PrintMode    dc.b    0
  2445.     even
  2446. Windowdef8    dc.w    635-174,50,174,100
  2447.     dc.b    -1,-1
  2448.     dc.l    GADGETUP
  2449.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  2450.     dc.l    Gadget_8_1
  2451.     dc.l    0
  2452.     dc.l    W8_Title
  2453.     dc.l    0,0
  2454.     dc.w    0,0,0,0,CUSTOMSCREEN
  2455. W8_Title    dc.b    "    Print Window     ",0
  2456.     even
  2457. Gadget_8_1    AUTOGADGET     10,20,154,12,3,1,<"Page Size">,1,Gadget_8_2
  2458.     even
  2459. Gadget_8_2    AUTOGADGET     10,40,154,12,3,1,<"Window Size">,3,Gadget_8_3
  2460.     even
  2461. Gadget_8_3    AUTOGADGET     10,60,154,12,3,1,<"Change Colours">,0,Gadget_8_4
  2462.     even
  2463. Gadget_8_4    AUTOGADGET     10,80,154,12,3,1,<"No - forget it !">,0,0
  2464.     even
  2465.  
  2466. Windowdef10    dc.w    5,50,174,100
  2467.     dc.b    -1,-1
  2468.     dc.l    GADGETUP
  2469.     dc.l    WINDOWDRAG!ACTIVATE!SMART_REFRESH
  2470.     dc.l    Gadget_10_1
  2471.     dc.l    0
  2472.     dc.l    W10_Title
  2473.     dc.l    0,0
  2474.     dc.w    0,0,0,0,CUSTOMSCREEN
  2475. W10_Title    dc.b    "    Print Screen      ",0
  2476.     even
  2477. Gadget_10_1    AUTOGADGET     10,20,154,12,3,1,<"Page Size">,0,Gadget_10_2
  2478.     even
  2479. Gadget_10_2    AUTOGADGET     10,40,154,12,3,1,<"Screen Size">,2,Gadget_8_3
  2480.     even
  2481.  
  2482.  
  2483. PrintWindow    move.b    #1,PrintMode
  2484.     lea.l    Gadget_8_3(pc),a0
  2485.     move.w    #TOGGLESELECT,gg_Activation(a0)
  2486.     lea.l    Windowdef8(pc),a0
  2487.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  2488.     CALLINT    OpenWindow
  2489.     tst.l    d0
  2490.     beq    .PW
  2491.     move.l    d0,Window2
  2492.  
  2493. WindowPointer set Window2
  2494.  
  2495.     SETAPEN    #2
  2496.     RECTFILL    #2,#10,#171,#98
  2497.     lea.l    Gadget_8_1,a0
  2498.     move.l    Window2(pc),a1
  2499.     sub.l    a2,a2
  2500.     CALLINT    RefreshGadgets
  2501.     move.l    Window2(pc),a0        
  2502.     move.l    wd_UserPort(a0),a0
  2503.     move.l    a0,a5
  2504.     CALLEXEC    WaitPort        
  2505.     move.l    a5,a0
  2506.     CALLEXEC    GetMsg        ; get message
  2507.     move.l    d0,a1    
  2508.     move.l    im_IAddress(a1),a4
  2509.     CALLEXEC     ReplyMsg        ; reply message        
  2510.     move.l    Window2(pc),a0
  2511.     CALLINT    CloseWindow
  2512.     move.b    gg_GadgetID+1(a4),PrintMode
  2513.     tst.b    PrintMode
  2514.     beq    wait
  2515. .PW    move.l    FENSTER(pc),a0
  2516.     CALLINT    ActivateWindow
  2517.     bra    PS1
  2518.  
  2519.  
  2520. PrintScreen    clr.b    PrintMode        ; print screen    
  2521.     lea.l    Gadget_8_3(pc),a0
  2522.     move.w    #TOGGLESELECT,gg_Activation(a0)
  2523.     lea.l    Windowdef10(pc),a0
  2524.     move.l    ScreenPtr1(pc),nw_Screen(a0)    
  2525.     CALLINT    OpenWindow
  2526.     tst.l    d0
  2527.     beq    PS1
  2528.     move.l    d0,Window2
  2529.  
  2530. WindowPointer set Window2
  2531.  
  2532.     SETAPEN    #2
  2533.     RECTFILL    #2,#10,#171,#98
  2534.     lea.l    Gadget_10_1,a0
  2535.     move.l    Window2(pc),a1
  2536.     sub.l    a2,a2
  2537.     CALLINT    RefreshGadgets
  2538.     move.l    Window2(pc),a0        
  2539.     move.l    wd_UserPort(a0),a0
  2540.     move.l    a0,a5
  2541.     CALLEXEC    WaitPort        
  2542.     move.l    a5,a0
  2543.     CALLEXEC    GetMsg        ; get message
  2544.     move.l    d0,a1    
  2545.     move.l    im_IAddress(a1),a4
  2546.     CALLEXEC     ReplyMsg        ; reply message        
  2547.     move.l    Window2(pc),a0
  2548.     CALLINT    CloseWindow
  2549.     move.b    gg_GadgetID+1(a4),PrintMode
  2550.     and.b    #$fe,PrintMode
  2551.     tst.b    PrintMode
  2552.     beq    wait
  2553.  
  2554. PS1    sub.l    a1,a1
  2555.     CALLEXEC    FindTask
  2556.     lea.l    Reply(pc),a1
  2557.     move.l    d0,$10(a1)
  2558.     CALLEXEC    AddPort
  2559.     lea    DevName(pc),a0
  2560.     lea.l    DevIO(pc),a1
  2561.     moveq.l    #0,d0    
  2562.     move.l    #iodrpr_SIZEOF,d1
  2563.     CALLEXEC    OpenDevice        ; open printer device
  2564.     tst.l    d0
  2565.     bne    .Error
  2566.  
  2567.     move.l    BILDSCHIRM(pc),a1
  2568.     lea.l    DevIO(pc),a0
  2569.  
  2570.     lea.l    sc_RastPort(a1),a2
  2571.     move.l    a2,io_RastPort(a0)
  2572.     btst    #0,PrintMode
  2573.     beq.s    .P1
  2574.     move.l    FENSTER(pc),a3
  2575.     move.l    wd_RPort(a3),io_RastPort(a0)
  2576.  
  2577. .P1    lea.l    sc_ViewPort(a1),a2
  2578.     move.l    vp_ColorMap(a2),a3
  2579.     move.l    a3,io_ColorMap(a0)
  2580.     move.l    cm_ColorTable(a3),a3
  2581.     move.l    (a3),PrintColors
  2582.     move.l    a3,ColorTable
  2583.  
  2584.     btst    #7,Gadget_8_3+gg_Flags+1    ; if selected set colours 0/1 to white/black
  2585.     beq    .P2
  2586.     move.l    #$0fff0000,(a3)    
  2587.  
  2588.  
  2589. .P2    moveq.l    #0,d0
  2590.     move.w    vp_Modes(a2),d0
  2591.     move.l    d0,io_Modes(a0)
  2592.     
  2593.     move.w    #0,io_SrcX(a0)
  2594.     move.w    #0,io_SrcY(a0)
  2595.     move.w    sc_Width(a1),io_SrcWidth(a0)
  2596.     move.w    sc_Height(a1),io_SrcHeight(a0)
  2597.     moveq.l    #0,d0
  2598.     move.l    d0,io_DestCols(a0)
  2599.     move.l    d0,io_DestRows(a0)
  2600.     btst    #0,PrintMode
  2601.     beq.s    .P3
  2602.     move.l    FENSTER(pc),a3
  2603.     move.w    wd_Width(a3),io_SrcWidth(a0)
  2604.     move.w    wd_Height(a3),io_SrcHeight(a0)
  2605.  
  2606.  
  2607. .P3    btst    #1,PrintMode        ; use page size ?
  2608.     beq.s    .P5
  2609.     moveq.l    #0,d2
  2610.     moveq.l    #0,d3
  2611.     move.w    sc_Width(a3),d2
  2612.     move.w    sc_Height(a3),d3
  2613.     move.l    d2,io_DestCols(a0)    ; use pic size
  2614.     move.l    d3,io_DestRows(a0)
  2615.     btst    #0,PrintMode
  2616.     beq.s    .P5
  2617.     moveq.l    #0,d2
  2618.     moveq.l    #0,d3
  2619.     move.w    wd_Width(a3),d2
  2620.     move.w    wd_Height(a3),d3
  2621.     move.l    d2,io_DestCols(a0)    ; use pic size
  2622.     move.l    d3,io_DestRows(a0)
  2623.     
  2624. .P5    moveq.l    #0,d0
  2625.     move.w    d0,io_Special(a0)
  2626.     move.w    #PRD_DUMPRPORT,IO_COMMAND(a0)
  2627.     move.l    #Reply,14(a0)
  2628.     
  2629.     move.l    a0,a1
  2630.     CALLEXEC    DoIO
  2631.  
  2632.     move.l    ColorTable(pc),a3    ; restore colours
  2633.     move.l    PrintColors(pc),(a3)
  2634.     
  2635.     lea.l    DevIO(pc),a1
  2636.     move.b    IO_ERROR(a1),d0
  2637.     CALLEXEC    CloseDevice
  2638.     
  2639. .Error    lea.l    Reply(pc),a1
  2640.     CALLEXEC    RemPort
  2641.     bra    wait
  2642. DevName    dc.b    "printer.device",0
  2643. Reply    ds.l    8
  2644. DevIO    ds.b    iodrpr_SIZEOF
  2645.     even
  2646. PrintColors    dc.l    0
  2647. ColorTable    dc.l    0
  2648.  
  2649.  
  2650. ColReq    move.l    BILDSCHIRM(pc),a0
  2651.     CALLINT    ScreenToFront
  2652.     move.l    _XColorBase(pc),d0    ; which library ???
  2653.     bne.s    .XColor
  2654.     move.l    BILDSCHIRM(pc),a1    ; colour requester (color.library needed)
  2655.     sub.l    a0,a0
  2656.     move.l    _ColorBase(pc),a6
  2657.     jsr    -30(a6)
  2658.     move.l    d0,d5
  2659.     move.l    ScreenPtr1(pc),a0
  2660.     CALLINT    ScreenToFront
  2661.     tst.l    d5
  2662.     bmi    Error
  2663.     bra    wait
  2664.  
  2665. ; use xcolor library
  2666.  
  2667. .XColor    lea.l    .Palette(pc),a0    ; put up ColorRequester structure
  2668.     move.l    BILDSCHIRM(pc),CR_Screen(a0)    ; ^screen
  2669.     move.b    #0,CR_TextColour(a0)    ; pens
  2670.     move.b    #1,CR_BackColour(a0)
  2671.     move.b    #2,CR_GBorderColour(a0)
  2672.     move.b    #0,CR_GTextColour(a0)
  2673.     move.w    #10,CR_LeftEdge(a0)    ; X,Y
  2674.     move.w    #10,CR_TopEdge(a0)
  2675.     move.l    #4,CR_DefaultEntries(a0)    ; default workbench palette
  2676.     move.l    #.DefaultPalette,CR_DefaultColourMap(a0)
  2677.     move.l    #.ScreenTitle,CR_ScreenTitle(a0)    ; screen title        
  2678.     move.l    #.WindowTitle,CR_DefaultWTitle(a0)    ; defalut window title        
  2679.  
  2680.     clr.l    CR_JMPWindow(a0)    ; no user interface
  2681.     clr.l    CR_JMPDraw(a0)
  2682.     clr.l    CR_JMPMode(a0)
  2683.     clr.l    CR_JMPMessage(a0)
  2684.     clr.l    CR_Font(a0)        ; use default font (should be 8x8)
  2685.     clr.l    CR_Mode(a0)
  2686.  
  2687.     move.l    #FLAG_RMBTRAP!FLAG_NORMAL!FLAG_RGB,CR_Flags(a0)
  2688.  
  2689.     CALLXCOLOR    ColourRequester
  2690.     
  2691.     move.l    ScreenPtr1(pc),a0
  2692.     CALLINT    ScreenToFront
  2693.     bra    wait
  2694.  
  2695. .Palette    ds.b    CR_SIZEOF
  2696.     even
  2697. .DefaultPalette    dc.w    $05a,$fff,$000,$f80
  2698.     even
  2699. .ScreenTitle    dc.b    "XCOLOR LIBRARY BY ROGER FISCHLIN",0
  2700.     even
  2701. .WindowTitle    dc.b    "Palette                           ",0
  2702.     even
  2703.  
  2704. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  2705.  
  2706. TOP    move.l    BILDSCHIRM(pc),a0    ; move screnen to left edge
  2707.     move.l    #-1000,d1
  2708.     move.l    #-1000,d0
  2709.     CALLINT    MoveScreen
  2710.     bra    wait
  2711.     
  2712.  
  2713.  
  2714.  
  2715. Windowdef    dc.w    20,20,140,10
  2716.     dc.b    -1,-1
  2717.     dc.l    MOUSEBUTTONS!CLOSEWINDOW
  2718.     dc.l    WINDOWDRAG!WINDOWCLOSE!ACTIVATE!SMART_REFRESH!WINDOWDEPTH!RMBTRAP
  2719.     dc.l    0
  2720.     dc.l    0
  2721.     dc.l    W_Title
  2722.     dc.l    0,0
  2723.     dc.w    0,0,0,0,WBENCHSCREEN
  2724. W_Title    dc.b    "Fenster      ",0
  2725.     even 
  2726. WindowPtr    dc.l    0
  2727.  
  2728. Init    lea.l    Windowdef(pc),a0    ; create window on WB    
  2729.     CALLINT    OpenWindow
  2730.     tst.l    d0
  2731.     beq    ende
  2732.     move.l    d0,WindowPtr
  2733.  
  2734.  
  2735. .wait    move.l    WindowPtr(pc),a0    ; wait .....
  2736.     move.l    wd_UserPort(a0),a0
  2737.     move.l    a0,a5
  2738.     CALLEXEC    WaitPort        
  2739.     move.l    a5,a0
  2740.     CALLEXEC    GetMsg        ; get message
  2741.     move.l    d0,a1    
  2742.     move.l    im_Class(a1),d4    ; get data
  2743.     move.w    im_Code(a1),d5
  2744.     CALLEXEC     ReplyMsg        ; reply message        
  2745.     cmp.l    #MOUSEBUTTONS,d4        ; right mouse button pressed ?
  2746.     bne.s    .Close
  2747.     cmp.w    #MENUDOWN,d5
  2748.     bne.s    .wait
  2749.     bsr    Start        ; open FENSTER
  2750.     bra.s    .wait
  2751. .Close    move.l    WindowPtr(pc),a0
  2752.     CALLINT    CloseWindow
  2753.     rts
  2754.  
  2755.  
  2756.  
  2757.